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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void Translator::emitConstants() { | 97 void Translator::emitConstants() { |
98 if (!Ctx->getFlags().DisableTranslation && Func) | 98 if (!Ctx->getFlags().DisableTranslation && Func) |
99 Func->getTarget()->emitConstants(); | 99 Func->getTarget()->emitConstants(); |
100 } | 100 } |
101 | 101 |
102 void Translator::lowerGlobals( | 102 void Translator::lowerGlobals( |
103 const VariableDeclarationListType &VariableDeclarations) { | 103 const VariableDeclarationListType &VariableDeclarations) { |
104 llvm::OwningPtr<TargetGlobalInitLowering> GlobalLowering( | 104 llvm::OwningPtr<TargetGlobalInitLowering> GlobalLowering( |
105 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); | 105 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); |
106 bool DisableTranslation = Ctx->getFlags().DisableTranslation; | 106 bool DisableTranslation = Ctx->getFlags().DisableTranslation; |
107 bool DumpGlobalVariables = | 107 const bool DumpGlobalVariables = |
108 Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); | 108 ALLOW_DUMP && Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); |
109 Ostream &Stream = Ctx->getStrDump(); | 109 Ostream &Stream = Ctx->getStrDump(); |
110 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; | 110 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; |
111 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { | 111 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { |
112 if (DumpGlobalVariables) | 112 if (DumpGlobalVariables) |
113 Global->dump(getContext(), Stream); | 113 Global->dump(getContext(), Stream); |
114 if (!DisableTranslation && | 114 if (!DisableTranslation && |
115 matchSymbolName(Global->getName(), TranslateOnly)) | 115 matchSymbolName(Global->getName(), TranslateOnly)) |
116 GlobalLowering->lower(*Global); | 116 GlobalLowering->lower(*Global); |
117 } | 117 } |
118 GlobalLowering.reset(); | 118 GlobalLowering.reset(); |
119 } | 119 } |
OLD | NEW |