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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 Func->emit(); | 90 Func->emit(); |
91 } | 91 } |
92 } | 92 } |
93 Ctx->dumpStats(Func->getFunctionName()); | 93 Ctx->dumpStats(Func->getFunctionName()); |
94 } | 94 } |
95 | 95 |
96 Ctx->setVerbose(OldVerboseMask); | 96 Ctx->setVerbose(OldVerboseMask); |
97 } | 97 } |
98 | 98 |
99 void Translator::emitConstants() { | 99 void Translator::emitConstants() { |
100 if (!Ctx->getFlags().DisableTranslation && Func) | 100 if (!Ctx->getFlags().DisableTranslation && Func) { |
101 Func->getTarget()->emitConstants(); | 101 if (Ctx->getFlags().UseELFWriter) { |
| 102 // TODO(jvoung): create the rodata.cst.{4,8} sections for UseELFWriter. |
| 103 } else { |
| 104 Func->getTarget()->emitConstants(); |
| 105 } |
| 106 } |
102 } | 107 } |
103 | 108 |
104 void Translator::lowerGlobals( | 109 void Translator::lowerGlobals( |
105 const VariableDeclarationListType &VariableDeclarations) { | 110 const VariableDeclarationListType &VariableDeclarations) { |
106 std::unique_ptr<TargetGlobalInitLowering> GlobalLowering( | 111 std::unique_ptr<TargetGlobalInitLowering> GlobalLowering( |
107 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); | 112 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); |
108 bool DisableTranslation = Ctx->getFlags().DisableTranslation; | 113 bool DisableTranslation = Ctx->getFlags().DisableTranslation; |
109 const bool DumpGlobalVariables = | 114 const bool DumpGlobalVariables = |
110 ALLOW_DUMP && Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); | 115 ALLOW_DUMP && Ctx->isVerbose() && Ctx->getFlags().VerboseFocusOn.empty(); |
111 Ostream &Stream = Ctx->getStrDump(); | 116 Ostream &Stream = Ctx->getStrDump(); |
112 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; | 117 const IceString &TranslateOnly = Ctx->getFlags().TranslateOnly; |
113 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { | 118 for (const Ice::VariableDeclaration *Global : VariableDeclarations) { |
114 if (DumpGlobalVariables) | 119 if (DumpGlobalVariables) |
115 Global->dump(getContext(), Stream); | 120 Global->dump(getContext(), Stream); |
116 if (!DisableTranslation && | 121 if (!DisableTranslation && |
117 matchSymbolName(Global->getName(), TranslateOnly)) | 122 matchSymbolName(Global->getName(), TranslateOnly)) |
118 GlobalLowering->lower(*Global); | 123 GlobalLowering->lower(*Global); |
119 } | 124 } |
120 GlobalLowering.reset(); | 125 GlobalLowering.reset(); |
121 } | 126 } |
OLD | NEW |