summaryrefslogtreecommitdiffstats
path: root/lib/Archive
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Archive')
-rw-r--r--lib/Archive/Archive.cpp5
-rw-r--r--lib/Archive/ArchiveInternals.h3
-rw-r--r--lib/Archive/ArchiveReader.cpp27
-rw-r--r--lib/Archive/ArchiveWriter.cpp5
4 files changed, 21 insertions, 19 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 1eab27d..1f36a00 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -12,15 +12,16 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Bitcode/Archive.h"
#include "ArchiveInternals.h"
#include "llvm/Bitcode/ReaderWriter.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/system_error.h"
-#include <memory>
#include <cstring>
+#include <memory>
using namespace llvm;
// getMemberSize - compute the actual physical size of the file member as seen
diff --git a/lib/Archive/ArchiveInternals.h b/lib/Archive/ArchiveInternals.h
index 639f5ac..f6c87e8 100644
--- a/lib/Archive/ArchiveInternals.h
+++ b/lib/Archive/ArchiveInternals.h
@@ -14,10 +14,9 @@
#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H
#define LIB_ARCHIVE_ARCHIVEINTERNALS_H
+#include "llvm/ADT/StringExtras.h"
#include "llvm/Bitcode/Archive.h"
#include "llvm/Support/TimeValue.h"
-#include "llvm/ADT/StringExtras.h"
-
#include <cstring>
#define ARFILE_MAGIC "!<arch>\n" ///< magic string
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp
index 5052495..14713e6 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 <cstdio>
#include <cstdlib>
-#include <memory>
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<Archive> result ( new Archive(file, C));
+ OwningPtr<Archive> 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<Archive> result ( new Archive(file, C) );
+ OwningPtr<Archive> 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
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index ec6b4b8..3eba701 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -11,18 +11,19 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/Bitcode/Archive.h"
#include "ArchiveInternals.h"
-#include "llvm/Module.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/Bitcode/ReaderWriter.h"
+#include "llvm/IR/Module.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/system_error.h"
#include <fstream>
-#include <ostream>
#include <iomanip>
+#include <ostream>
using namespace llvm;
// Write an integer using variable bit rate encoding. This saves a few bytes
OpenPOWER on IntegriCloud