X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-dis%2Fllvm-dis.cpp;h=9fb056510c007a188a707880cf23649cebdd5b0e;hb=ccbfd5b18a79a07229f11af478843eae16ac9b26;hp=cea6219a30f21dfed64877b166f79f3b41dd3fd6;hpb=f010c464a11444733ec67e31aace8bcebeaf2588;p=oota-llvm.git diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index cea6219a30f..9fb056510c0 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/tools/llvm-dis/llvm-dis.cpp @@ -16,12 +16,13 @@ // //===----------------------------------------------------------------------===// -#include "llvm/LLVMContext.h" -#include "llvm/Assembly/AssemblyAnnotationWriter.h" +#include "llvm/IR/LLVMContext.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/DebugInfo.h" -#include "llvm/IntrinsicInst.h" -#include "llvm/Module.h" +#include "llvm/IR/AssemblyAnnotationWriter.h" +#include "llvm/IR/IntrinsicInst.h" +#include "llvm/IR/Module.h" +#include "llvm/IR/Type.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/DataStream.h" #include "llvm/Support/FormattedStream.h" @@ -31,7 +32,6 @@ #include "llvm/Support/Signals.h" #include "llvm/Support/ToolOutputFile.h" #include "llvm/Support/system_error.h" -#include "llvm/Type.h" using namespace llvm; static cl::opt @@ -123,7 +123,7 @@ int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n"); std::string ErrorMessage; - std::auto_ptr M; + OwningPtr M; // Use the bitcode streaming interface DataStreamer *streamer = getDataFileStreamer(InputFilename, &ErrorMessage); @@ -135,8 +135,11 @@ int main(int argc, char **argv) { DisplayFilename = InputFilename; M.reset(getStreamedBitcodeModule(DisplayFilename, streamer, Context, &ErrorMessage)); - if(M.get() != 0 && M->MaterializeAllPermanently(&ErrorMessage)) { - M.reset(); + if(M.get() != 0) { + if (error_code EC = M->materializeAllPermanently()) { + ErrorMessage = EC.message(); + M.reset(); + } } } @@ -168,9 +171,8 @@ int main(int argc, char **argv) { } std::string ErrorInfo; - OwningPtr - Out(new tool_output_file(OutputFilename.c_str(), ErrorInfo, - raw_fd_ostream::F_Binary)); + OwningPtr Out(new tool_output_file( + OutputFilename.c_str(), ErrorInfo, sys::fs::F_Binary)); if (!ErrorInfo.empty()) { errs() << ErrorInfo << '\n'; return 1;