| OLD | NEW |
| 1 //===- subzero/src/IceTranslator.cpp - ICE to machine code ------*- C++ -*-===// | 1 //===- subzero/src/IceTranslator.cpp - ICE to machine code ------*- C++ -*-===// |
| 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 the general driver class for translating ICE to | 10 // This file defines the general driver class for translating ICE to |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 !matchSymbolName(Func->getFunctionName(), | 76 !matchSymbolName(Func->getFunctionName(), |
| 77 Ctx->getFlags().TranslateOnly)) { | 77 Ctx->getFlags().TranslateOnly)) { |
| 78 Func->dump(); | 78 Func->dump(); |
| 79 } else { | 79 } else { |
| 80 Func->translate(); | 80 Func->translate(); |
| 81 if (Func->hasError()) { | 81 if (Func->hasError()) { |
| 82 std::cerr << "ICE translation error: " << Func->getError() << "\n"; | 82 std::cerr << "ICE translation error: " << Func->getError() << "\n"; |
| 83 ErrorStatus = true; | 83 ErrorStatus = true; |
| 84 } | 84 } |
| 85 | 85 |
| 86 Func->emit(); | 86 if (Ctx->getFlags().UseIntegratedAssembler) { |
| 87 Func->emitIAS(); |
| 88 } else { |
| 89 Func->emit(); |
| 90 } |
| 87 Ctx->dumpStats(Func->getFunctionName()); | 91 Ctx->dumpStats(Func->getFunctionName()); |
| 88 } | 92 } |
| 89 | 93 |
| 90 Ctx->setVerbose(OldVerboseMask); | 94 Ctx->setVerbose(OldVerboseMask); |
| 91 } | 95 } |
| 92 | 96 |
| 93 void Translator::emitConstants() { | 97 void Translator::emitConstants() { |
| 94 if (!Ctx->getFlags().DisableTranslation && Func) | 98 if (!Ctx->getFlags().DisableTranslation && Func) |
| 95 Func->getTarget()->emitConstants(); | 99 Func->getTarget()->emitConstants(); |
| 96 } | 100 } |
| 97 | 101 |
| 98 void Translator::lowerGlobals( | 102 void Translator::lowerGlobals( |
| 99 const VariableDeclarationListType &VariableDeclarations) { | 103 const VariableDeclarationListType &VariableDeclarations) { |
| 100 llvm::OwningPtr<TargetGlobalInitLowering> GlobalLowering( | 104 llvm::OwningPtr<TargetGlobalInitLowering> GlobalLowering( |
| 101 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); | 105 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); |
| 102 bool DisableTranslation = Ctx->getFlags().DisableTranslation; | 106 bool DisableTranslation = Ctx->getFlags().DisableTranslation; |
| 103 bool DumpGlobalVariables = | 107 bool DumpGlobalVariables = |
| 104 Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); | 108 Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); |
| 105 Ostream &Stream = Ctx->getStrDump(); | 109 Ostream &Stream = Ctx->getStrDump(); |
| 106 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; | 110 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; |
| 107 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { | 111 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { |
| 108 if (DumpGlobalVariables) | 112 if (DumpGlobalVariables) |
| 109 Global->dump(getContext(), Stream); | 113 Global->dump(getContext(), Stream); |
| 110 if (!DisableTranslation && | 114 if (!DisableTranslation && |
| 111 matchSymbolName(Global->getName(), TranslateOnly)) | 115 matchSymbolName(Global->getName(), TranslateOnly)) |
| 112 GlobalLowering->lower(*Global); | 116 GlobalLowering->lower(*Global); |
| 113 } | 117 } |
| 114 GlobalLowering.reset(); | 118 GlobalLowering.reset(); |
| 115 } | 119 } |
| OLD | NEW |