OLD | NEW |
1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// | 1 //===- subzero/src/IceCompiler.cpp - Driver for bitcode translation -------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
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 a driver for translating PNaCl bitcode into native code. | 10 // This file defines a driver for translating PNaCl bitcode into native code. |
(...skipping 29 matching lines...) Expand all Loading... |
40 {"disable_ir_gen", ALLOW_DISABLE_IR_GEN}, | 40 {"disable_ir_gen", ALLOW_DISABLE_IR_GEN}, |
41 {"llvm_cl", ALLOW_LLVM_CL}, | 41 {"llvm_cl", ALLOW_LLVM_CL}, |
42 {"llvm_ir", ALLOW_LLVM_IR}, | 42 {"llvm_ir", ALLOW_LLVM_IR}, |
43 {"llvm_ir_as_input", ALLOW_LLVM_IR_AS_INPUT}, | 43 {"llvm_ir_as_input", ALLOW_LLVM_IR_AS_INPUT}, |
44 {"minimal_build", ALLOW_MINIMAL_BUILD}, | 44 {"minimal_build", ALLOW_MINIMAL_BUILD}, |
45 {"browser_mode", PNACL_BROWSER_TRANSLATOR}}; | 45 {"browser_mode", PNACL_BROWSER_TRANSLATOR}}; |
46 | 46 |
47 // Validates values of build attributes. Prints them to Stream if | 47 // Validates values of build attributes. Prints them to Stream if |
48 // Stream is non-null. | 48 // Stream is non-null. |
49 void ValidateAndGenerateBuildAttributes(const ClFlags &Flags, Ostream *Stream) { | 49 void ValidateAndGenerateBuildAttributes(const ClFlags &Flags, Ostream *Stream) { |
50 if (Stream) | 50 if (Stream) { |
| 51 // List the requested target. |
51 *Stream << Flags.getTargetArch() << "\n"; | 52 *Stream << Flags.getTargetArch() << "\n"; |
52 | 53 |
| 54 // List the supported targets. |
| 55 #define SUBZERO_TARGET(TARGET) *Stream << "target_" #TARGET << "\n"; |
| 56 #include "llvm/Config/SZTargets.def" |
| 57 } |
| 58 |
53 for (size_t i = 0; i < llvm::array_lengthof(ConditionalBuildAttributes); | 59 for (size_t i = 0; i < llvm::array_lengthof(ConditionalBuildAttributes); |
54 ++i) { | 60 ++i) { |
55 switch (ConditionalBuildAttributes[i].FlagValue) { | 61 switch (ConditionalBuildAttributes[i].FlagValue) { |
56 case 0: | 62 case 0: |
57 if (Stream) | 63 if (Stream) |
58 *Stream << "no_" << ConditionalBuildAttributes[i].FlagName << "\n"; | 64 *Stream << "no_" << ConditionalBuildAttributes[i].FlagName << "\n"; |
59 break; | 65 break; |
60 case 1: | 66 case 1: |
61 if (Stream) | 67 if (Stream) |
62 *Stream << "allow_" << ConditionalBuildAttributes[i].FlagName << "\n"; | 68 *Stream << "allow_" << ConditionalBuildAttributes[i].FlagName << "\n"; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 Ctx.dumpTimers(); | 161 Ctx.dumpTimers(); |
156 if (Ctx.getFlags().getTimeEachFunction()) { | 162 if (Ctx.getFlags().getTimeEachFunction()) { |
157 const bool DumpCumulative = false; | 163 const bool DumpCumulative = false; |
158 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); | 164 Ctx.dumpTimers(GlobalContext::TSK_Funcs, DumpCumulative); |
159 } | 165 } |
160 const bool FinalStats = true; | 166 const bool FinalStats = true; |
161 Ctx.dumpStats("_FINAL_", FinalStats); | 167 Ctx.dumpStats("_FINAL_", FinalStats); |
162 } | 168 } |
163 | 169 |
164 } // end of namespace Ice | 170 } // end of namespace Ice |
OLD | NEW |