X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=tools%2Flli%2Flli.cpp;h=b69e91c5d4dd7b539a964390ac8a7aa55baf8306;hp=c8edf5529459b4bd9372534b469f5d1e580d8e23;hb=1a7f705fba4b387ad251b0f303acec5c7131971d;hpb=548f2b6e8fc5499fa8c9394fe7d110f50c487802 diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index c8edf552945..b69e91c5d4d 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -268,13 +268,13 @@ public: std::string CacheName; if (!getCacheFilename(ModuleID, CacheName)) return; - std::string errStr; if (!CacheDir.empty()) { // Create user-defined cache dir. SmallString<128> dir(CacheName); sys::path::remove_filename(dir); sys::fs::create_directories(Twine(dir)); } - raw_fd_ostream outfile(CacheName.c_str(), errStr, sys::fs::F_None); + std::error_code EC; + raw_fd_ostream outfile(CacheName, EC, sys::fs::F_None); outfile.write(Obj.getBufferStart(), Obj.getBufferSize()); outfile.close(); } @@ -294,8 +294,7 @@ public: // because the file has probably just been mmapped. Instead we make // a copy. The filed-based buffer will be released when it goes // out of scope. - return std::unique_ptr( - MemoryBuffer::getMemBufferCopy(IRObjectBuffer.get()->getBuffer())); + return MemoryBuffer::getMemBufferCopy(IRObjectBuffer.get()->getBuffer()); } private: @@ -399,7 +398,7 @@ int main(int argc, char **argv, char * const *envp) { // Load the bitcode... SMDiagnostic Err; - std::unique_ptr Owner(ParseIRFile(InputFile, Err, Context)); + std::unique_ptr Owner = parseIRFile(InputFile, Err, Context); Module *Mod = Owner.get(); if (!Mod) { Err.print(argv[0], errs()); @@ -513,7 +512,7 @@ int main(int argc, char **argv, char * const *envp) { // Load any additional modules specified on the command line. for (unsigned i = 0, e = ExtraModules.size(); i != e; ++i) { - std::unique_ptr XMod(ParseIRFile(ExtraModules[i], Err, Context)); + std::unique_ptr XMod = parseIRFile(ExtraModules[i], Err, Context); if (!XMod) { Err.print(argv[0], errs()); return 1; @@ -536,7 +535,8 @@ int main(int argc, char **argv, char * const *envp) { Err.print(argv[0], errs()); return 1; } - EE->addObjectFile(std::move(Obj.get().getBinary())); + object::OwningBinary &O = Obj.get(); + EE->addObjectFile(std::move(O)); } for (unsigned i = 0, e = ExtraArchives.size(); i != e; ++i) {