Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Side by Side Diff: unittest/BitcodeMunge.h

Issue 1848303003: Simplify references to command line flags. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | unittest/BitcodeMunge.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- BitcodeMunge.h - Subzero Bitcode Munger ------------------*- C++ -*-===// 1 //===- BitcodeMunge.h - Subzero 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 testing malformed bitcode files in Subzero. Uses NaCl's 10 // Test harness for testing malformed bitcode files in Subzero. Uses NaCl's
(...skipping 15 matching lines...) Expand all
26 namespace IceTest { 26 namespace IceTest {
27 27
28 // Class to run tests on Subzero's bitcode parser. Runs a Subzero 28 // Class to run tests on Subzero's bitcode parser. Runs a Subzero
29 // translation, using (possibly) edited bitcode record values. For 29 // translation, using (possibly) edited bitcode record values. For
30 // more details on how to represent the input arrays, see 30 // more details on how to represent the input arrays, see
31 // NaClBitcodeMunge.h. 31 // NaClBitcodeMunge.h.
32 class SubzeroBitcodeMunger : public llvm::NaClBitcodeMunger { 32 class SubzeroBitcodeMunger : public llvm::NaClBitcodeMunger {
33 public: 33 public:
34 SubzeroBitcodeMunger(const uint64_t Records[], size_t RecordSize, 34 SubzeroBitcodeMunger(const uint64_t Records[], size_t RecordSize,
35 uint64_t RecordTerminator) 35 uint64_t RecordTerminator)
36 : llvm::NaClBitcodeMunger(Records, RecordSize, RecordTerminator), 36 : llvm::NaClBitcodeMunger(Records, RecordSize, RecordTerminator) {
37 Flags(Ice::GlobalContext::Flags) {
38 resetMungeFlags(); 37 resetMungeFlags();
39 } 38 }
40 39
41 /// Runs PNaClTranslator to parse and (optionally) translate bitcode records 40 /// Runs PNaClTranslator to parse and (optionally) translate bitcode records
42 /// (with defined record Munges), and puts output into DumpResults. Returns 41 /// (with defined record Munges), and puts output into DumpResults. Returns
43 /// true if parse is successful. 42 /// true if parse is successful.
44 bool runTest(const uint64_t Munges[], size_t MungeSize, 43 bool runTest(const uint64_t Munges[], size_t MungeSize,
45 bool DisableTranslation = false); 44 bool DisableTranslation = false);
46 45
47 /// Same as above, but without any edits. 46 /// Same as above, but without any edits.
48 bool runTest(bool DisableTranslation = false) { 47 bool runTest(bool DisableTranslation = false) {
49 uint64_t NoMunges[] = {0}; 48 uint64_t NoMunges[] = {0};
50 return runTest(NoMunges, 0, DisableTranslation); 49 return runTest(NoMunges, 0, DisableTranslation);
51 } 50 }
52 51
53 /// Flags to use to run tests. Use to change default assumptions.
54 Ice::ClFlags &Flags;
55
56 private: 52 private:
57 void resetMungeFlags(); 53 void resetMungeFlags();
58 }; 54 };
59 55
60 } // end of namespace IceTest 56 } // end of namespace IceTest
61 57
62 #endif // SUBZERO_UNITTEST_BITCODEMUNGE_H 58 #endif // SUBZERO_UNITTEST_BITCODEMUNGE_H
OLDNEW
« no previous file with comments | « src/PNaClTranslator.cpp ('k') | unittest/BitcodeMunge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698