Chromium Code Reviews| Index: include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h |
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h b/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h |
| index 42f4bcf6683c9d9e0351f18c87cadbbb77c5898c..523d89aa9a482c39f8e73435b7652426df55ff70 100644 |
| --- a/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h |
| +++ b/include/llvm/Bitcode/NaCl/NaClBitcodeMunge.h |
| @@ -13,7 +13,7 @@ |
| // Generates a bitcode memory buffer from an array containing 1 or |
| // more PNaCl records. Used to test errors in PNaCl bitcode. |
| // |
| -// Bitcode records are modeleled using arrays using the format |
| +// Bitcode records are modeled using arrays using the format |
| // specified in NaClBitcodeMungeUtils.h. |
| // |
| // Note: Since the header record doesn't have any abbreviation indices |
| @@ -47,7 +47,6 @@ |
| namespace llvm { |
| -class NaClBitstreamWriter; |
| class NaClBitCodeAbbrev; |
| /// Base class to run tests on munged bitcode files. |
| @@ -64,14 +63,16 @@ public: |
| static const EditAction Remove = NaClMungedBitcode::Remove; |
| static const EditAction Replace = NaClMungedBitcode::Replace; |
| + /// The write flags to use when writing bitcode. |
| + NaClMungedBitcode::WriteFlags WriteFlags; |
|
jvoung (off chromium)
2015/05/06 22:08:09
nit: Seems a bit weird for this field to be public
Karl
2015/05/07 20:09:18
Moved to protected and added methods to set. Made
|
| + |
| /// Creates a bitcode munger, based on the given array of values. |
| NaClBitcodeMunger(const uint64_t Records[], size_t RecordsSize, |
| uint64_t RecordTerminator) |
| : MungedBitcode(Records, RecordsSize, RecordTerminator), |
| - RecordTerminator(RecordTerminator), WriteBlockID(-1), SetBID(-1), |
| + RecordTerminator(RecordTerminator), |
| DumpResults("Error: No previous dump results!\n"), |
| - DumpStream(nullptr), Writer(nullptr), FoundErrors(false), |
| - FatalBuffer(), FatalStream(FatalBuffer) {} |
| + DumpStream(nullptr), FoundErrors(false) {} |
| /// Creates MungedInput and DumpStream for running tests, based on |
| /// given Munges. |
| @@ -104,26 +105,14 @@ protected: |
| NaClMungedBitcode MungedBitcode; |
| // The value used as record terminator. |
| uint64_t RecordTerminator; |
| - // The block ID associated with the block being written. |
| - int WriteBlockID; |
| - // The SetBID for the blockinfo block. |
| - int SetBID; |
| // The results buffer of the last dump. |
| std::string DumpResults; |
| // The memory buffer containing the munged input. |
| std::unique_ptr<MemoryBuffer> MungedInput; |
| // The stream containing errors and the objdump of the generated bitcode file. |
| raw_ostream *DumpStream; |
| - // The bitstream writer to use to generate the bitcode file. |
| - NaClBitstreamWriter *Writer; |
| // True if any errors were reported. |
| bool FoundErrors; |
| - // The buffer to hold the generated fatal message. |
| - std::string FatalBuffer; |
| - // The stream to write the fatal message to. |
| - raw_string_ostream FatalStream; |
| - // The stack of maximum abbreviation indices allowed by block enter record. |
| - SmallVector<uint64_t, 3> AbbrevIndexLimitStack; |
| // The buffer for the contents of the munged input. |
| SmallVector<char, 1024> MungedInputBuffer; |
| @@ -134,33 +123,11 @@ protected: |
| return *DumpStream << "Error: "; |
| } |
| - // Returns stream to print fatal error message to. |
| - // Note: Once the fatal error message has been dumped to the stream, |
| - // one must call ReportFatalError to display the error and terminate |
| - // execution. |
| - raw_ostream &Fatal() { |
| - return FatalStream << "Fatal: "; |
| - } |
| - |
| - // Displays the fatal error message and exits the program. |
| - void ReportFatalError() { |
| - report_fatal_error(FatalStream.str()); |
| - } |
| - |
| // Returns the lines containing the given Substring, from the string |
| // getTestResults(). If MustBePrefix, then Substring must match at |
| // the beginning of the line. |
| std::string getLinesWithTextMatch(const std::string &Substring, |
| bool MustBePrefix = false) const; |
| - |
| - // Writes out munged bitcode records. |
| - void writeMungedBitcode(const NaClMungedBitcode &Bitcode, bool AddHeader); |
| - |
| - // Emits the given record to the bitcode file. |
| - void emitRecord(const NaClBitcodeAbbrevRecord &Record); |
| - |
| - // Converts the abbreviation record to the corresponding abbreviation. |
| - NaClBitCodeAbbrev *buildAbbrev(const NaClBitcodeAbbrevRecord &Record); |
| }; |
| /// Class to run tests for function llvm::NaClObjDump. |