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

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: Fix problems from merging in 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
« pydir/run-llvm2ice.py ('K') | « 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..3dca661f36ca8773924cb6d22fb420d9f1453a6e 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",
@@ -267,10 +271,19 @@ int main(int argc, char **argv) {
Ice::TimerMarker T(Ice::TimerStack::TT_szmain, &Ctx);
int ErrorStatus = 0;
+#if ALLOW_LLVM_IR == 1
if (BuildOnRead) {
Jim Stichnoth 2014/10/28 20:45:35 Could this #if construct be more like this? if (B
Karl 2014/10/28 21:43:51 Done.
+#else
+ if (!BuildOnRead) {
+ *Ls << "Error: Build doesn't allow LLVM IR, "
+ << "--build-on-read=0 not allowed\n";
+ return GetReturnValue(1);
+ }
+#endif
Ice::PNaClTranslator Translator(&Ctx, Flags);
Translator.translate(IRFilename);
ErrorStatus = Translator.getErrorStatus();
+#if ALLOW_LLVM_IR == 1
} else {
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
@@ -287,6 +300,7 @@ int main(int argc, char **argv) {
Converter.convertToIce();
ErrorStatus = Converter.getErrorStatus();
}
+#endif
if (TimeEachFunction) {
const bool DumpCumulative = false;
Ctx.dumpTimers(Ice::GlobalContext::TSK_Funcs, DumpCumulative);
« pydir/run-llvm2ice.py ('K') | « pydir/run-llvm2ice.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698