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 |
248 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { | 285 void ClFlags::getParsedClFlags(ClFlags &OutFlags) { |
249 if (::DisableIRGeneration) | 286 if (::DisableIRGeneration) |
250 ::DisableTranslation = true; | 287 ::DisableTranslation = true; |
251 | 288 |
252 Ice::VerboseMask VMask = Ice::IceV_None; | 289 Ice::VerboseMask VMask = Ice::IceV_None; |
253 // Don't generate verbose messages if routines | 290 // Don't generate verbose messages if routines |
254 // to dump messages are not available. | 291 // to dump messages are not available. |
255 if (ALLOW_DUMP) { | 292 if (ALLOW_DUMP) { |
256 for (unsigned i = 0; i != VerboseList.size(); ++i) | 293 for (unsigned i = 0; i != VerboseList.size(); ++i) |
257 VMask |= VerboseList[i]; | 294 VMask |= VerboseList[i]; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); | 332 OutFlagsExtra.setGenerateBuildAtts(GenerateBuildAtts); |
296 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); | 333 OutFlagsExtra.setLLVMVerboseErrors(LLVMVerboseErrors); |
297 OutFlagsExtra.setAppName(AppName); | 334 OutFlagsExtra.setAppName(AppName); |
298 OutFlagsExtra.setInputFileFormat(InputFileFormat); | 335 OutFlagsExtra.setInputFileFormat(InputFileFormat); |
299 OutFlagsExtra.setIRFilename(IRFilename); | 336 OutFlagsExtra.setIRFilename(IRFilename); |
300 OutFlagsExtra.setLogFilename(LogFilename); | 337 OutFlagsExtra.setLogFilename(LogFilename); |
301 OutFlagsExtra.setOutputFilename(OutputFilename); | 338 OutFlagsExtra.setOutputFilename(OutputFilename); |
302 } | 339 } |
303 | 340 |
304 } // end of namespace Ice | 341 } // end of namespace Ice |
OLD | NEW |