OLD | NEW |
1 //===- subzero/src/IceClFlags.cpp - Command line flags and parsing --------===// | 1 //===- subzero/src/IceClFlags.cpp - Command line flags and parsing --------===// |
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 commandline flags parsing. | 10 // This file defines commandline flags parsing. |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 } // end of anonymous namespace | 239 } // end of anonymous namespace |
240 | 240 |
241 namespace Ice { | 241 namespace Ice { |
242 | 242 |
243 void ClFlags::parseFlags(int argc, char **argv) { | 243 void ClFlags::parseFlags(int argc, char **argv) { |
244 cl::ParseCommandLineOptions(argc, argv); | 244 cl::ParseCommandLineOptions(argc, argv); |
245 AppName = IceString(argv[0]); | 245 AppName = IceString(argv[0]); |
246 } | 246 } |
247 | 247 |
248 void ClFlags::resetClFlags(ClFlags &OutFlags) { | |
249 // bool fields | |
250 OutFlags.AllowErrorRecovery = false; | |
251 OutFlags.AllowUninitializedGlobals = false; | |
252 OutFlags.DataSections = false; | |
253 OutFlags.DecorateAsm = false; | |
254 OutFlags.DisableInternal = false; | |
255 OutFlags.DisableIRGeneration = false; | |
256 OutFlags.DisableTranslation = false; | |
257 OutFlags.DumpStats = false; | |
258 OutFlags.FunctionSections = false; | |
259 OutFlags.GenerateUnitTestMessages = false; | |
260 OutFlags.PhiEdgeSplit = false; | |
261 OutFlags.RandomNopInsertion = false; | |
262 OutFlags.RandomRegAlloc = false; | |
263 OutFlags.SubzeroTimingEnabled = false; | |
264 OutFlags.TimeEachFunction = false; | |
265 OutFlags.UseSandboxing = false; | |
266 // Enum and integer fields. | |
267 OutFlags.Opt = Opt_m1; | |
268 OutFlags.OutFileType = FT_Iasm; | |
269 OutFlags.RandomMaxNopsPerInstruction = 0; | |
270 OutFlags.RandomNopProbabilityAsPercentage = 0; | |
271 OutFlags.TArch = TargetArch_NUM; | |
272 OutFlags.VMask = IceV_None; | |
273 // IceString fields. | |
274 OutFlags.DefaultFunctionPrefix = ""; | |
275 OutFlags.DefaultGlobalPrefix = ""; | |
276 OutFlags.TestPrefix = ""; | |
277 OutFlags.TimingFocusOn = ""; | |
278 OutFlags.TranslateOnly = ""; | |
279 OutFlags.VerboseFocusOn = ""; | |
280 // size_t and 64-bit fields. | |
281 OutFlags.NumTranslationThreads = 0; | |
282 OutFlags.RandomSeed = 0; | |
283 } | |
284 | |
285 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { | 248 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { |
286 if (::DisableIRGeneration) | 249 if (::DisableIRGeneration) |
287 ::DisableTranslation = true; | 250 ::DisableTranslation = true; |
288 | 251 |
289 Ice::VerboseMask VMask = Ice::IceV_None; | 252 Ice::VerboseMask VMask = Ice::IceV_None; |
290 // Don't generate verbose messages if routines | 253 // Don't generate verbose messages if routines |
291 // to dump messages are not available. | 254 // to dump messages are not available. |
292 if (ALLOW_DUMP) { | 255 if (ALLOW_DUMP) { |
293 for (unsigned i = 0; i != VerboseList.size(); ++i) | 256 for (unsigned i = 0; i != VerboseList.size(); ++i) |
294 VMask |= VerboseList[i]; | 257 VMask |= VerboseList[i]; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); | 295 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); |
333 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); | 296 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); |
334 OutFlagsExtra.setAppName(AppName); | 297 OutFlagsExtra.setAppName(AppName); |
335 OutFlagsExtra.setInputFileFormat(InputFileFormat); | 298 OutFlagsExtra.setInputFileFormat(InputFileFormat); |
336 OutFlagsExtra.setIRFilename(IRFilename); | 299 OutFlagsExtra.setIRFilename(IRFilename); |
337 OutFlagsExtra.setLogFilename(LogFilename); | 300 OutFlagsExtra.setLogFilename(LogFilename); |
338 OutFlagsExtra.setOutputFilename(OutputFilename); | 301 OutFlagsExtra.setOutputFilename(OutputFilename); |
339 } | 302 } |
340 | 303 |
341 } // end of namespace Ice | 304 } // end of namespace Ice |
OLD | NEW |