From 4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 8 Apr 2013 18:41:23 +0000 Subject: Vendor import of llvm trunk r178860: http://llvm.org/svn/llvm-project/llvm/trunk@178860 --- lib/Archive/ArchiveReader.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'lib/Archive/ArchiveReader.cpp') diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 5052495c0d62e..14713e692c0f3 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -11,14 +11,15 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Bitcode/Archive.h" #include "ArchiveInternals.h" +#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/Bitcode/ReaderWriter.h" +#include "llvm/IR/Module.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Module.h" #include #include -#include using namespace llvm; /// Read a variable-bit-rate encoded unsigned integer @@ -176,7 +177,7 @@ Archive::parseMemberHeader(const char*& At, const char* End, std::string* error) } if (p >= endp) { if (error) - *error = "missing name termiantor in string table"; + *error = "missing name terminator in string table"; return 0; } } else { @@ -325,14 +326,14 @@ Archive::loadArchive(std::string* error) { // Open and completely load the archive file. Archive* -Archive::OpenAndLoad(const sys::Path& file, LLVMContext& C, +Archive::OpenAndLoad(const sys::Path& File, LLVMContext& C, std::string* ErrorMessage) { - std::auto_ptr result ( new Archive(file, C)); + OwningPtr result ( new Archive(File, C)); if (result->mapToMemory(ErrorMessage)) - return 0; + return NULL; if (!result->loadArchive(ErrorMessage)) - return 0; - return result.release(); + return NULL; + return result.take(); } // Get all the bitcode modules from the archive @@ -439,15 +440,15 @@ Archive::loadSymbolTable(std::string* ErrorMsg) { } // Open the archive and load just the symbol tables -Archive* Archive::OpenAndLoadSymbols(const sys::Path& file, +Archive* Archive::OpenAndLoadSymbols(const sys::Path& File, LLVMContext& C, std::string* ErrorMessage) { - std::auto_ptr result ( new Archive(file, C) ); + OwningPtr result ( new Archive(File, C) ); if (result->mapToMemory(ErrorMessage)) - return 0; + return NULL; if (!result->loadSymbolTable(ErrorMessage)) - return 0; - return result.release(); + return NULL; + return result.take(); } // Look up one symbol in the symbol table and return the module that defines -- cgit v1.2.3