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

Unified Diff: src/llvm2ice.cpp

Issue 689433002: Remove IceConverter when LLVM IR is not allowed. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Merged with master Created 6 years, 2 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 | « pydir/run-llvm2ice.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/llvm2ice.cpp
diff --git a/src/llvm2ice.cpp b/src/llvm2ice.cpp
index 6573acd6f82b8ba645ba29f81e10fe36ad1484af..d117b58afce3a2bd59f3d7afc93397076d87aaa1 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -148,10 +148,14 @@ static cl::opt<std::string>
"unnamed functions"),
cl::init("Function"));
+// Note: While this flag isn't used in the minimal build, we keep this
+// flag so that tests can set this command-line flag without concern
+// to the type of build. We double check that this flag at runtime
+// to make sure the consistency is maintained.
static cl::opt<bool>
-BuildOnRead("build-on-read",
- cl::desc("Build ICE instructions when reading bitcode"),
- cl::init(false));
+ BuildOnRead("build-on-read",
+ cl::desc("Build ICE instructions when reading bitcode"),
+ cl::init(true));
static cl::opt<bool>
UseIntegratedAssembler("integrated-as",
@@ -271,7 +275,7 @@ int main(int argc, char **argv) {
Ice::PNaClTranslator Translator(&Ctx, Flags);
Translator.translate(IRFilename);
ErrorStatus = Translator.getErrorStatus();
- } else {
+ } else if (ALLOW_LLVM_IR) {
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
Ice::TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
@@ -286,6 +290,10 @@ int main(int argc, char **argv) {
Ice::Converter Converter(Mod, &Ctx, Flags);
Converter.convertToIce();
ErrorStatus = Converter.getErrorStatus();
+ } else {
+ *Ls << "Error: Build doesn't allow LLVM IR, "
+ << "--build-on-read=0 not allowed\n";
+ return GetReturnValue(1);
}
if (TimeEachFunction) {
const bool DumpCumulative = false;
« no previous file with comments | « pydir/run-llvm2ice.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698