OLD | NEW |
1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// | 1 //===- subzero/src/llvm2ice.cpp - Driver for testing ----------------------===// |
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 that uses LLVM capabilities to parse a | 10 // This file defines a driver that uses LLVM capabilities to parse a |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 cl::values( | 52 cl::values( |
53 clEnumValN(Ice::Target_X8632, "x8632", "x86-32"), | 53 clEnumValN(Ice::Target_X8632, "x8632", "x86-32"), |
54 clEnumValN(Ice::Target_X8632, "x86-32", "x86-32 (same as x8632)"), | 54 clEnumValN(Ice::Target_X8632, "x86-32", "x86-32 (same as x8632)"), |
55 clEnumValN(Ice::Target_X8632, "x86_32", "x86-32 (same as x8632)"), | 55 clEnumValN(Ice::Target_X8632, "x86_32", "x86-32 (same as x8632)"), |
56 clEnumValN(Ice::Target_X8664, "x8664", "x86-64"), | 56 clEnumValN(Ice::Target_X8664, "x8664", "x86-64"), |
57 clEnumValN(Ice::Target_X8664, "x86-64", "x86-64 (same as x8664)"), | 57 clEnumValN(Ice::Target_X8664, "x86-64", "x86-64 (same as x8664)"), |
58 clEnumValN(Ice::Target_X8664, "x86_64", "x86-64 (same as x8664)"), | 58 clEnumValN(Ice::Target_X8664, "x86_64", "x86-64 (same as x8664)"), |
59 clEnumValN(Ice::Target_ARM32, "arm", "arm32"), | 59 clEnumValN(Ice::Target_ARM32, "arm", "arm32"), |
60 clEnumValN(Ice::Target_ARM32, "arm32", "arm32 (same as arm)"), | 60 clEnumValN(Ice::Target_ARM32, "arm32", "arm32 (same as arm)"), |
61 clEnumValN(Ice::Target_ARM64, "arm64", "arm64"), clEnumValEnd)); | 61 clEnumValN(Ice::Target_ARM64, "arm64", "arm64"), clEnumValEnd)); |
| 62 static cl::opt<bool> UseSandboxing("sandbox", cl::desc("Use sandboxing")); |
62 static cl::opt<bool> | 63 static cl::opt<bool> |
63 FunctionSections("ffunction-sections", | 64 FunctionSections("ffunction-sections", |
64 cl::desc("Emit functions into separate sections")); | 65 cl::desc("Emit functions into separate sections")); |
65 static cl::opt<Ice::OptLevel> | 66 static cl::opt<Ice::OptLevel> |
66 OptLevel(cl::desc("Optimization level"), cl::init(Ice::Opt_m1), | 67 OptLevel(cl::desc("Optimization level"), cl::init(Ice::Opt_m1), |
67 cl::value_desc("level"), | 68 cl::value_desc("level"), |
68 cl::values(clEnumValN(Ice::Opt_m1, "Om1", "-1"), | 69 cl::values(clEnumValN(Ice::Opt_m1, "Om1", "-1"), |
69 clEnumValN(Ice::Opt_m1, "O-1", "-1"), | 70 clEnumValN(Ice::Opt_m1, "O-1", "-1"), |
70 clEnumValN(Ice::Opt_0, "O0", "0"), | 71 clEnumValN(Ice::Opt_0, "O0", "0"), |
71 clEnumValN(Ice::Opt_1, "O1", "1"), | 72 clEnumValN(Ice::Opt_1, "O1", "1"), |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } | 129 } |
129 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); | 130 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); |
130 Ls->SetUnbuffered(); | 131 Ls->SetUnbuffered(); |
131 | 132 |
132 Ice::ClFlags Flags; | 133 Ice::ClFlags Flags; |
133 Flags.DisableInternal = DisableInternal; | 134 Flags.DisableInternal = DisableInternal; |
134 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; | 135 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; |
135 Flags.DisableTranslation = DisableTranslation; | 136 Flags.DisableTranslation = DisableTranslation; |
136 Flags.DisableGlobals = DisableGlobals; | 137 Flags.DisableGlobals = DisableGlobals; |
137 Flags.FunctionSections = FunctionSections; | 138 Flags.FunctionSections = FunctionSections; |
| 139 Flags.UseSandboxing = UseSandboxing; |
138 | 140 |
139 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, | 141 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, |
140 Flags); | 142 Flags); |
141 | 143 |
142 if (BuildOnRead) { | 144 if (BuildOnRead) { |
143 Ice::PNaClTranslator Translator(&Ctx); | 145 Ice::PNaClTranslator Translator(&Ctx); |
144 Translator.translate(IRFilename); | 146 Translator.translate(IRFilename); |
145 return Translator.getErrorStatus(); | 147 return Translator.getErrorStatus(); |
146 } else { | 148 } else { |
147 // Parse the input LLVM IR file into a module. | 149 // Parse the input LLVM IR file into a module. |
(...skipping 10 matching lines...) Expand all Loading... |
158 if (!Mod) { | 160 if (!Mod) { |
159 Err.print(argv[0], errs()); | 161 Err.print(argv[0], errs()); |
160 return 1; | 162 return 1; |
161 } | 163 } |
162 | 164 |
163 Ice::Converter Converter(&Ctx); | 165 Ice::Converter Converter(&Ctx); |
164 Converter.convertToIce(Mod); | 166 Converter.convertToIce(Mod); |
165 return Converter.getErrorStatus(); | 167 return Converter.getErrorStatus(); |
166 } | 168 } |
167 } | 169 } |
OLD | NEW |