Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 920953002: Subzero: Use -filetype instead of -ias and -elf-writer. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Explicitly set the output file type for unit tests Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « src/IceGlobalContext.cpp ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698