#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
-#include "llvm/PassManager.h"
#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Assembly/PrintModulePass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
OutputFilename = IFN+".ll";
}
}
-
+
+ // Make sure that the Out file gets unlinked from the disk if we get a
+ // SIGINT.
+ if (OutputFilename != "-")
+ sys::RemoveFileOnSignal(sys::Path(OutputFilename));
+
std::string ErrorInfo;
std::auto_ptr<raw_fd_ostream>
Out(new raw_fd_ostream(OutputFilename.c_str(), ErrorInfo,
return 1;
}
- // Make sure that the Out file gets unlinked from the disk if we get a
- // SIGINT.
- if (OutputFilename != "-")
- sys::RemoveFileOnSignal(sys::Path(OutputFilename));
-
// All that llvm-dis does is write the assembly to a file.
- if (!DontPrint) {
- PassManager Passes;
- Passes.add(createPrintModulePass(Out.get()));
- Passes.run(*M.get());
- }
+ if (!DontPrint)
+ *Out << *M;
return 0;
}