OLD | NEW |
1 //===- NaClBitcodeMungeUtils.h - Munge bitcode records --------*- C++ -*-===// | 1 //===- NaClBitcodeMungeUtils.h - Munge bitcode records --------*- C++ -*-===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file defines utility class NaClMungedBitcode to edit a base | 10 // This file defines utility class NaClMungedBitcode to edit a base |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 /// Read in the list of records from binary bitcode from a memory buffer. | 105 /// Read in the list of records from binary bitcode from a memory buffer. |
106 void readNaClBitcodeRecordList(NaClBitcodeRecordList &RecordList, | 106 void readNaClBitcodeRecordList(NaClBitcodeRecordList &RecordList, |
107 std::unique_ptr<MemoryBuffer> InputBuffer); | 107 std::unique_ptr<MemoryBuffer> InputBuffer); |
108 | 108 |
109 /// Read in the list of records from textual bitcode from a memory buffer. | 109 /// Read in the list of records from textual bitcode from a memory buffer. |
110 std::error_code readNaClTextBcRecordList( | 110 std::error_code readNaClTextBcRecordList( |
111 NaClBitcodeRecordList &RecordList, | 111 NaClBitcodeRecordList &RecordList, |
112 std::unique_ptr<MemoryBuffer> InputBuffer); | 112 std::unique_ptr<MemoryBuffer> InputBuffer); |
113 | 113 |
| 114 /// Read textual bitcode records from Filename, and fill Buffer with |
| 115 /// corresponding bitcode. Return error_code describing success of |
| 116 /// read. Verbose (if not nullptr) is used to generate more human |
| 117 /// readable error messages than the text in the returned error |
| 118 /// message. |
| 119 std::error_code readNaClRecordTextAndBuildBitcode( |
| 120 StringRef Filename, SmallVectorImpl<char> &Buffer, |
| 121 raw_ostream *Verbose = nullptr); |
| 122 |
114 /// Write out RecordList (as text) to Buffer. Returns true when | 123 /// Write out RecordList (as text) to Buffer. Returns true when |
115 /// successful. Error message are written to ErrStream. | 124 /// successful. Error message are written to ErrStream. |
116 bool writeNaClBitcodeRecordList(NaClBitcodeRecordList &RecordList, | 125 bool writeNaClBitcodeRecordList(NaClBitcodeRecordList &RecordList, |
117 SmallVectorImpl<char> &Buffer, | 126 SmallVectorImpl<char> &Buffer, |
118 raw_ostream &ErrStream); | 127 raw_ostream &ErrStream); |
119 | 128 |
120 /// \brief An edited (i.e. munged) list of bitcode records. Edits are | 129 /// \brief An edited (i.e. munged) list of bitcode records. Edits are |
121 /// always relative to the initial list of records. | 130 /// always relative to the initial list of records. |
122 class NaClMungedBitcode { | 131 class NaClMungedBitcode { |
123 friend class NaClMungedBitcodeIter; | 132 friend class NaClMungedBitcodeIter; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 483 } |
475 | 484 |
476 // \brief Moves the iterator to the position of the next edited | 485 // \brief Moves the iterator to the position of the next edited |
477 // record. | 486 // record. |
478 void updatePosition(); | 487 void updatePosition(); |
479 }; | 488 }; |
480 | 489 |
481 } // end namespace llvm. | 490 } // end namespace llvm. |
482 | 491 |
483 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H | 492 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H |
OLD | NEW |