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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 DefaultFunctionPrefix("default-function-prefix", | 123 DefaultFunctionPrefix("default-function-prefix", |
124 cl::desc("Define default function prefix for naming " | 124 cl::desc("Define default function prefix for naming " |
125 "unnamed functions"), | 125 "unnamed functions"), |
126 cl::init("Function")); | 126 cl::init("Function")); |
127 | 127 |
128 static cl::opt<bool> | 128 static cl::opt<bool> |
129 BuildOnRead("build-on-read", | 129 BuildOnRead("build-on-read", |
130 cl::desc("Build ICE instructions when reading bitcode"), | 130 cl::desc("Build ICE instructions when reading bitcode"), |
131 cl::init(false)); | 131 cl::init(false)); |
132 | 132 |
| 133 static cl::opt<bool> |
| 134 UseIntegratedAssembler("integrated-as", |
| 135 cl::desc("Use integrated assembler (default yes)"), |
| 136 cl::init(true)); |
| 137 |
133 int main(int argc, char **argv) { | 138 int main(int argc, char **argv) { |
134 | 139 |
135 cl::ParseCommandLineOptions(argc, argv); | 140 cl::ParseCommandLineOptions(argc, argv); |
136 | 141 |
137 Ice::VerboseMask VMask = Ice::IceV_None; | 142 Ice::VerboseMask VMask = Ice::IceV_None; |
138 for (unsigned i = 0; i != VerboseList.size(); ++i) | 143 for (unsigned i = 0; i != VerboseList.size(); ++i) |
139 VMask |= VerboseList[i]; | 144 VMask |= VerboseList[i]; |
140 | 145 |
141 std::ofstream Ofs; | 146 std::ofstream Ofs; |
142 if (OutputFilename != "-") { | 147 if (OutputFilename != "-") { |
143 Ofs.open(OutputFilename.c_str(), std::ofstream::out); | 148 Ofs.open(OutputFilename.c_str(), std::ofstream::out); |
144 } | 149 } |
145 raw_os_ostream *Os = | 150 raw_os_ostream *Os = |
146 new raw_os_ostream(OutputFilename == "-" ? std::cout : Ofs); | 151 new raw_os_ostream(OutputFilename == "-" ? std::cout : Ofs); |
147 Os->SetUnbuffered(); | 152 Os->SetUnbuffered(); |
148 std::ofstream Lfs; | 153 std::ofstream Lfs; |
149 if (LogFilename != "-") { | 154 if (LogFilename != "-") { |
150 Lfs.open(LogFilename.c_str(), std::ofstream::out); | 155 Lfs.open(LogFilename.c_str(), std::ofstream::out); |
151 } | 156 } |
152 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); | 157 raw_os_ostream *Ls = new raw_os_ostream(LogFilename == "-" ? std::cout : Lfs); |
153 Ls->SetUnbuffered(); | 158 Ls->SetUnbuffered(); |
154 | 159 |
155 Ice::ClFlags Flags; | 160 Ice::ClFlags Flags; |
156 Flags.DisableInternal = DisableInternal; | 161 Flags.DisableInternal = DisableInternal; |
157 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; | 162 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; |
158 Flags.DisableTranslation = DisableTranslation; | 163 Flags.DisableTranslation = DisableTranslation; |
159 Flags.DisableGlobals = DisableGlobals; | 164 Flags.DisableGlobals = DisableGlobals; |
160 Flags.FunctionSections = FunctionSections; | 165 Flags.FunctionSections = FunctionSections; |
| 166 Flags.UseIntegratedAssembler = UseIntegratedAssembler; |
161 Flags.UseSandboxing = UseSandboxing; | 167 Flags.UseSandboxing = UseSandboxing; |
162 Flags.DumpStats = DumpStats; | 168 Flags.DumpStats = DumpStats; |
163 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; | 169 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; |
164 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; | 170 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; |
165 | 171 |
166 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, | 172 Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix, |
167 Flags); | 173 Flags); |
168 | 174 |
169 int ErrorStatus = 0; | 175 int ErrorStatus = 0; |
170 if (BuildOnRead) { | 176 if (BuildOnRead) { |
(...skipping 18 matching lines...) Expand all Loading... |
189 } | 195 } |
190 | 196 |
191 Ice::Converter Converter(Mod, &Ctx, Flags); | 197 Ice::Converter Converter(Mod, &Ctx, Flags); |
192 Converter.convertToIce(); | 198 Converter.convertToIce(); |
193 ErrorStatus = Converter.getErrorStatus(); | 199 ErrorStatus = Converter.getErrorStatus(); |
194 } | 200 } |
195 const bool FinalStats = true; | 201 const bool FinalStats = true; |
196 Ctx.dumpStats("_FINAL_", FinalStats); | 202 Ctx.dumpStats("_FINAL_", FinalStats); |
197 return ErrorStatus; | 203 return ErrorStatus; |
198 } | 204 } |
OLD | NEW |