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

Unified Diff: src/llvm2ice.cpp

Issue 361733002: Update Subzero to start parsing PNaCl bitcode files. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Reformat IceConverter.cpp Created 6 years, 5 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
« src/PNaClTranslator.cpp ('K') | « src/PNaClTranslator.cpp ('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 6d26cff53050f81a786b04a7a70d6d06991546da..822a0ce0389554614f88a2048c7bcc0e1aa5c966 100644
--- a/src/llvm2ice.cpp
+++ b/src/llvm2ice.cpp
@@ -14,12 +14,13 @@
//===----------------------------------------------------------------------===//
#include "IceCfg.h"
+#include "IceClFlags.h"
#include "IceConverter.h"
#include "IceDefs.h"
#include "IceTargetLowering.h"
#include "IceTypes.h"
+#include "PNaClTranslator.h"
-#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
@@ -128,9 +129,15 @@ int main(int argc, char **argv) {
Ice::GlobalContext Ctx(Ls, Os, VMask, TargetArch, OptLevel, TestPrefix);
+ Ice::ClFlags Flags;
+ Flags.DisableInternal = DisableInternal;
+ Flags.SubzeroTimingEnabled = SubzeroTimingEnabled;
+ Flags.DisableTranslation = DisableTranslation;
+
if (BuildOnRead) {
- std::cerr << "Direct build from bitcode not implemented yet!\n";
- return 1;
+ Ice::PNaClTranslator Translator(&Ctx, Flags);
+ Translator.translate(IRFilename);
+ return Translator.getExitStatus();
} else {
// Parse the input LLVM IR file into a module.
SMDiagnostic Err;
@@ -189,8 +196,7 @@ int main(int argc, char **argv) {
}
GlobalLowering.reset();
- Ice::Converter Converter(&Ctx, DisableInternal, SubzeroTimingEnabled,
- DisableTranslation);
+ Ice::Converter Converter(&Ctx, Flags);
return Converter.convertToIce(Mod);
}
}
« src/PNaClTranslator.cpp ('K') | « src/PNaClTranslator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698