Hold the LLVMContext by reference rather than by pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74640 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-01 21:22:36 +00:00
parent fcd65ae28f
commit 31895e7359
55 changed files with 107 additions and 98 deletions

View File

@@ -138,7 +138,7 @@ bool ArchiveMember::replaceWith(const sys::Path& newFile, std::string* ErrMsg) {
// Archive constructor - this is the only constructor that gets used for the
// Archive class. Everything else (default,copy) is deprecated. This just
// initializes and maps the file into memory, if requested.
Archive::Archive(const sys::Path& filename, LLVMContext* C)
Archive::Archive(const sys::Path& filename, const LLVMContext& C)
: archPath(filename), members(), mapfile(0), base(0), symTab(), strtab(),
symTabSize(0), firstFileOffset(0), modules(), foreignST(0), Context(C) {
}
@@ -208,7 +208,7 @@ static void getSymbols(Module*M, std::vector<std::string>& symbols) {
// Get just the externally visible defined symbols from the bitcode
bool llvm::GetBitcodeSymbols(const sys::Path& fName,
LLVMContext* Context,
const LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
std::auto_ptr<MemoryBuffer> Buffer(
@@ -240,7 +240,7 @@ bool llvm::GetBitcodeSymbols(const sys::Path& fName,
ModuleProvider*
llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
const std::string& ModuleID,
LLVMContext* Context,
const LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
// Get the module provider

View File

@@ -73,13 +73,13 @@ namespace llvm {
// Get just the externally visible defined symbols from the bitcode
bool GetBitcodeSymbols(const sys::Path& fName,
LLVMContext* Context,
const LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
ModuleProvider* GetBitcodeSymbols(const unsigned char*Buffer,unsigned Length,
const std::string& ModuleID,
LLVMContext* Context,
const LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
}

View File

@@ -327,7 +327,7 @@ 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, const LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C));
if (result->mapToMemory(ErrorMessage))
@@ -441,7 +441,8 @@ Archive::loadSymbolTable(std::string* ErrorMsg) {
}
// Open the archive and load just the symbol tables
Archive* Archive::OpenAndLoadSymbols(const sys::Path& file, LLVMContext* C,
Archive* Archive::OpenAndLoadSymbols(const sys::Path& file,
const LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C) );
if (result->mapToMemory(ErrorMessage))

View File

@@ -64,7 +64,7 @@ static inline unsigned numVbrBytes(unsigned num) {
}
// Create an empty archive.
Archive* Archive::CreateEmpty(const sys::Path& FilePath, LLVMContext* C) {
Archive* Archive::CreateEmpty(const sys::Path& FilePath, const LLVMContext& C) {
Archive* result = new Archive(FilePath, C);
return result;
}