Chromium Code Reviews| Index: tools/llc/llc.cpp |
| diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp |
| index a61233ee636011e664f8920189c78f6ce3aa0567..7c1ccc12c4d67d1dd92eaefd40427aa0044916c1 100644 |
| --- a/tools/llc/llc.cpp |
| +++ b/tools/llc/llc.cpp |
| @@ -18,6 +18,7 @@ |
| #include "llvm/PassManager.h" |
| #include "llvm/Pass.h" |
| #include "llvm/ADT/Triple.h" |
| +#include "llvm/Bitcode/BitcodeStream.h" |
| #include "llvm/Support/IRReader.h" |
| #include "llvm/CodeGen/LinkAllAsmWriterComponents.h" |
| #include "llvm/CodeGen/LinkAllCodegenComponents.h" |
| @@ -329,7 +330,11 @@ int llc_main(int argc, char **argv) { |
| Context)); |
| M->setModuleIdentifier(InputFilename); |
| #else |
| - M.reset(ParseIRFile(InputFilename, Err, Context)); |
| + //M.reset(ParseIRFile(InputFilename, Err, Context)); |
| + StreamChunkCallback cb = GetBitcodeFileStream(InputFilename, Err); |
| + if (cb) { |
| + M.reset(getLazyIRStreamModule(InputFilename, Err, Context, cb)); |
| + } |
| #endif // defined(__native_client__) && defined(NACL_SRPC) |
| if (M.get() == 0) { |
| Err.print(argv[0], errs()); |
| @@ -445,7 +450,7 @@ int llc_main(int argc, char **argv) { |
| } |
| // Build up all of the passes that we want to do to the module. |
| - PassManager PM; |
| + FunctionPassManager PM(&mod); |
| // Add the target data from the target machine, if it exists, or the module. |
| if (const TargetData *TD = Target.getTargetData()) |
| @@ -498,7 +503,11 @@ int llc_main(int argc, char **argv) { |
| // Before executing passes, print the final values of the LLVM options. |
| cl::PrintOptionValues(); |
| - PM.run(mod); |
|
jasonwkim
2011/10/25 21:34:12
Why did you expand this?
(google.com) Derek Schuff
2011/10/25 22:23:22
Because the module-level pass manager caused the w
|
| + PM.doInitialization(); |
| + for (Module::iterator I = mod.begin(), E = mod.end(); I != E; ++I) { |
| + PM.run(*I); |
| + } |
| + PM.doFinalization(); |
| } |
| // Declare success. |