| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 if (GenerateBuildAtts) | 291 if (GenerateBuildAtts) |
| 292 return GetReturnValue(Ice::EC_None); | 292 return GetReturnValue(Ice::EC_None); |
| 293 | 293 |
| 294 if (!ALLOW_DISABLE_IR_GEN && DisableIRGeneration) { | 294 if (!ALLOW_DISABLE_IR_GEN && DisableIRGeneration) { |
| 295 *Ls << "Error: Build doesn't allow --no-ir-gen when not " | 295 *Ls << "Error: Build doesn't allow --no-ir-gen when not " |
| 296 << "ALLOW_DISABLE_IR_GEN!\n"; | 296 << "ALLOW_DISABLE_IR_GEN!\n"; |
| 297 return GetReturnValue(Ice::EC_Args); | 297 return GetReturnValue(Ice::EC_Args); |
| 298 } | 298 } |
| 299 | 299 |
| 300 Ice::ClFlags Flags; | 300 Ice::ClFlags Flags; |
| 301 Flags.DisableInternal = DisableInternal; | 301 Flags.setDisableInternal(DisableInternal); |
| 302 Flags.SubzeroTimingEnabled = SubzeroTimingEnabled; | 302 Flags.setSubzeroTimingEnabled(SubzeroTimingEnabled); |
| 303 Flags.DisableTranslation = DisableTranslation; | 303 Flags.setDisableTranslation(DisableTranslation); |
| 304 Flags.FunctionSections = FunctionSections; | 304 Flags.setFunctionSections(FunctionSections); |
| 305 Flags.DataSections = DataSections; | 305 Flags.setDataSections(DataSections); |
| 306 Flags.UseELFWriter = UseELFWriter; | 306 Flags.setUseELFWriter(UseELFWriter); |
| 307 Flags.UseIntegratedAssembler = UseIntegratedAssembler; | 307 Flags.setUseIntegratedAssembler(UseIntegratedAssembler); |
| 308 Flags.UseSandboxing = UseSandboxing; | 308 Flags.setUseSandboxing(UseSandboxing); |
| 309 Flags.PhiEdgeSplit = EnablePhiEdgeSplit; | 309 Flags.setPhiEdgeSplit(EnablePhiEdgeSplit); |
| 310 Flags.DecorateAsm = DecorateAsm; | 310 Flags.setDecorateAsm(DecorateAsm); |
| 311 Flags.DumpStats = DumpStats; | 311 Flags.setDumpStats(DumpStats); |
| 312 Flags.AllowUninitializedGlobals = AllowUninitializedGlobals; | 312 Flags.setAllowUninitializedGlobals(AllowUninitializedGlobals); |
| 313 Flags.TimeEachFunction = TimeEachFunction; | 313 Flags.setTimeEachFunction(TimeEachFunction); |
| 314 Flags.NumTranslationThreads = NumThreads; | 314 Flags.setNumTranslationThreads(NumThreads); |
| 315 Flags.DefaultGlobalPrefix = DefaultGlobalPrefix; | 315 Flags.setDefaultGlobalPrefix(DefaultGlobalPrefix); |
| 316 Flags.DefaultFunctionPrefix = DefaultFunctionPrefix; | 316 Flags.setDefaultFunctionPrefix(DefaultFunctionPrefix); |
| 317 Flags.TimingFocusOn = TimingFocusOn; | 317 Flags.setTimingFocusOn(TimingFocusOn); |
| 318 Flags.VerboseFocusOn = VerboseFocusOn; | 318 Flags.setVerboseFocusOn(VerboseFocusOn); |
| 319 Flags.TranslateOnly = TranslateOnly; | 319 Flags.setTranslateOnly(TranslateOnly); |
| 320 Flags.DisableIRGeneration = DisableIRGeneration; | 320 Flags.setDisableIRGeneration(DisableIRGeneration); |
| 321 Flags.AllowErrorRecovery = AllowErrorRecovery; | 321 Flags.setAllowErrorRecovery(AllowErrorRecovery); |
| 322 Flags.StubConstantCalls = StubConstantCalls; | 322 Flags.setStubConstantCalls(StubConstantCalls); |
| 323 | 323 |
| 324 // Force -build-on-read=0 for .ll files. | 324 // Force -build-on-read=0 for .ll files. |
| 325 const std::string LLSuffix = ".ll"; | 325 const std::string LLSuffix = ".ll"; |
| 326 if (IRFilename.length() >= LLSuffix.length() && | 326 if (IRFilename.length() >= LLSuffix.length() && |
| 327 IRFilename.compare(IRFilename.length() - LLSuffix.length(), | 327 IRFilename.compare(IRFilename.length() - LLSuffix.length(), |
| 328 LLSuffix.length(), LLSuffix) == 0) | 328 LLSuffix.length(), LLSuffix) == 0) |
| 329 BuildOnRead = false; | 329 BuildOnRead = false; |
| 330 | 330 |
| 331 // With the ELF writer, use a raw_fd_ostream to allow seeking. | 331 // With the ELF writer, use a raw_fd_ostream to allow seeking. |
| 332 // Also don't buffer, otherwise it gets pretty slow. | 332 // Also don't buffer, otherwise it gets pretty slow. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 if (SubzeroTimingEnabled) | 411 if (SubzeroTimingEnabled) |
| 412 Ctx.dumpTimers(); | 412 Ctx.dumpTimers(); |
| 413 if (TimeEachFunction) { | 413 if (TimeEachFunction) { |
| 414 const bool DumpCumulative = false; | 414 const bool DumpCumulative = false; |
| 415 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); | 415 Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative); |
| 416 } | 416 } |
| 417 const bool FinalStats = true; | 417 const bool FinalStats = true; |
| 418 Ctx.dumpStats("_FINAL_", FinalStats); | 418 Ctx.dumpStats("_FINAL_", FinalStats); |
| 419 return GetReturnValue(Ctx.getErrorStatus()->value()); | 419 return GetReturnValue(Ctx.getErrorStatus()->value()); |
| 420 } | 420 } |
| OLD | NEW |