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

Unified Diff: src/IceCompiler.cpp

Issue 1284493003: Subzero: Misc fixes/cleanup. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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/IceCfgNode.cpp ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompiler.cpp
diff --git a/src/IceCompiler.cpp b/src/IceCompiler.cpp
index 23733ce78b9abb6d1e1188857d5c74066a9b98a3..e4d9b1cab4896e9e740966eed24ed2c36f8f3ec2 100644
--- a/src/IceCompiler.cpp
+++ b/src/IceCompiler.cpp
@@ -93,8 +93,19 @@ void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
return Ctx.getErrorStatus()->assign(EC_None);
if (!BuildDefs::disableIrGen() && Ctx.getFlags().getDisableIRGeneration()) {
- Ctx.getStrDump() << "Error: Build doesn't allow --no-ir-gen when not "
- << "ALLOW_DISABLE_IR_GEN!\n";
+ Ctx.getStrError() << "Error: Build doesn't allow --no-ir-gen when not "
+ << "ALLOW_DISABLE_IR_GEN!\n";
+ return Ctx.getErrorStatus()->assign(EC_Args);
+ }
+
+ // The Minimal build (specifically, when dump()/emit() are not implemented)
+ // allows only --filetype=obj. Check here to avoid cryptic error messages
+ // downstream.
+ if (!BuildDefs::dump() && Ctx.getFlags().getOutFileType() != FT_Elf) {
+ // TODO(stichnot): Access the actual command-line argument via
+ // llvm::Option.ArgStr and .ValueStr .
+ Ctx.getStrError()
+ << "Error: only --filetype=obj is supported in this build.\n";
return Ctx.getErrorStatus()->assign(EC_Args);
}
@@ -121,7 +132,7 @@ void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
Translator.reset(PTranslator.release());
} else if (BuildDefs::llvmIr()) {
if (PNACL_BROWSER_TRANSLATOR) {
- Ctx.getStrDump()
+ Ctx.getStrError()
<< "non BuildOnRead is not supported w/ PNACL_BROWSER_TRANSLATOR\n";
return Ctx.getErrorStatus()->assign(EC_Args);
}
@@ -142,8 +153,8 @@ void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
Converter->convertToIce();
Translator.reset(Converter.release());
} else {
- Ctx.getStrDump() << "Error: Build doesn't allow LLVM IR, "
- << "--build-on-read=0 not allowed\n";
+ Ctx.getStrError() << "Error: Build doesn't allow LLVM IR, "
+ << "--build-on-read=0 not allowed\n";
return Ctx.getErrorStatus()->assign(EC_Args);
}
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInstARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698