Index: src/IceTargetLoweringX8632.cpp |
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
index 51f1f3b81bfd14a680d953be8630589cd28a25ce..0467320c68d16a3f32c6bb6a51486c7651bb2d92 100644 |
--- a/src/IceTargetLoweringX8632.cpp |
+++ b/src/IceTargetLoweringX8632.cpp |
@@ -4641,10 +4641,13 @@ void TargetDataX8632::lowerGlobal(const VariableDeclaration &Var) const { |
void TargetDataX8632::lowerGlobals( |
std::unique_ptr<VariableDeclarationList> Vars) const { |
- if (Ctx->getFlags().getUseELFWriter()) { |
+ switch (Ctx->getFlags().getOutFileType()) { |
+ case FT_Elf: { |
ELFObjectWriter *Writer = Ctx->getObjectWriter(); |
Writer->writeDataSection(*Vars, llvm::ELF::R_386_32); |
- } else { |
+ } break; |
+ case FT_Asm: |
+ case FT_Iasm: { |
const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly(); |
OstreamLocker L(Ctx); |
for (const VariableDeclaration *Var : *Vars) { |
@@ -4652,6 +4655,7 @@ void TargetDataX8632::lowerGlobals( |
lowerGlobal(*Var); |
} |
} |
+ } break; |
} |
} |
@@ -4716,14 +4720,18 @@ void TargetDataX8632::lowerConstants() const { |
return; |
// No need to emit constants from the int pool since (for x86) they |
// are embedded as immediates in the instructions, just emit float/double. |
- if (Ctx->getFlags().getUseELFWriter()) { |
+ switch (Ctx->getFlags().getOutFileType()) { |
+ case FT_Elf: { |
ELFObjectWriter *Writer = Ctx->getObjectWriter(); |
Writer->writeConstantPool<ConstantFloat>(IceType_f32); |
Writer->writeConstantPool<ConstantDouble>(IceType_f64); |
- } else { |
+ } break; |
+ case FT_Asm: |
+ case FT_Iasm: { |
OstreamLocker L(Ctx); |
emitConstantPool<PoolTypeConverter<float>>(Ctx); |
emitConstantPool<PoolTypeConverter<double>>(Ctx); |
+ } break; |
} |
} |