OLD | NEW |
1 //===- NaClBitcodeMunge.h - Bitcode Munger ----------------------*- C++ -*-===// | 1 //===- NaClBitcodeMunge.h - Bitcode Munger ----------------------*- 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 // Test harness for generating a PNaCl bitcode memory buffer from | 10 // Test harness for generating a PNaCl bitcode memory buffer from |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include <string> | 46 #include <string> |
47 | 47 |
48 namespace llvm { | 48 namespace llvm { |
49 | 49 |
50 class NaClBitstreamWriter; | 50 class NaClBitstreamWriter; |
51 class NaClBitCodeAbbrev; | 51 class NaClBitCodeAbbrev; |
52 | 52 |
53 /// Base class to run tests on munged bitcode files. | 53 /// Base class to run tests on munged bitcode files. |
54 class NaClBitcodeMunger { | 54 class NaClBitcodeMunger { |
55 public: | 55 public: |
56 // TODO(kschimpf) Replace uses in subzero with corresponding | |
57 // NaClMungedBitcode::EditAction values, so that following constants | |
58 // can be removed. | |
59 | |
60 /// The types of editing actions that can be applied. | |
61 typedef NaClMungedBitcode::EditAction EditAction; | |
62 static const EditAction AddBefore = NaClMungedBitcode::AddBefore; | |
63 static const EditAction AddAfter = NaClMungedBitcode::AddAfter; | |
64 static const EditAction Remove = NaClMungedBitcode::Remove; | |
65 static const EditAction Replace = NaClMungedBitcode::Replace; | |
66 | |
67 /// Creates a bitcode munger, based on the given array of values. | 56 /// Creates a bitcode munger, based on the given array of values. |
68 NaClBitcodeMunger(const uint64_t Records[], size_t RecordsSize, | 57 NaClBitcodeMunger(const uint64_t Records[], size_t RecordsSize, |
69 uint64_t RecordTerminator) | 58 uint64_t RecordTerminator) |
70 : MungedBitcode(Records, RecordsSize, RecordTerminator), | 59 : MungedBitcode(Records, RecordsSize, RecordTerminator), |
71 RecordTerminator(RecordTerminator), WriteBlockID(-1), SetBID(-1), | 60 RecordTerminator(RecordTerminator), WriteBlockID(-1), SetBID(-1), |
72 DumpResults("Error: No previous dump results!\n"), | 61 DumpResults("Error: No previous dump results!\n"), |
73 DumpStream(nullptr), Writer(nullptr), FoundErrors(false), | 62 DumpStream(nullptr), Writer(nullptr), FoundErrors(false), |
74 FatalBuffer(), FatalStream(FatalBuffer) {} | 63 FatalBuffer(), FatalStream(FatalBuffer) {} |
75 | 64 |
76 /// Creates MungedInput and DumpStream for running tests, based on | 65 /// Creates MungedInput and DumpStream for running tests, based on |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 273 |
285 bool runTest(const char* TestName) { | 274 bool runTest(const char* TestName) { |
286 uint64_t NoMunges[] = {0}; | 275 uint64_t NoMunges[] = {0}; |
287 return runTest(TestName, NoMunges, 0); | 276 return runTest(TestName, NoMunges, 0); |
288 } | 277 } |
289 }; | 278 }; |
290 | 279 |
291 } // end namespace llvm. | 280 } // end namespace llvm. |
292 | 281 |
293 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H | 282 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H |
OLD | NEW |