summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-01 23:13:44 +0000
committerOwen Anderson <resistor@mac.com>2009-07-01 23:13:44 +0000
commit4434ed44c45c87a72b7a0bf2f91211f895022b91 (patch)
treedc0e25b2f2b2706339e64e4f654d2a442ab97018 /lib
parent82c32c42724f92b899287b4f34029eb1170c43f9 (diff)
Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74655 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Archive/Archive.cpp6
-rw-r--r--lib/Archive/ArchiveInternals.h4
-rw-r--r--lib/Archive/ArchiveReader.cpp4
-rw-r--r--lib/Archive/ArchiveWriter.cpp2
-rw-r--r--lib/AsmParser/Parser.cpp4
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp4
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.h4
-rw-r--r--lib/Debugger/Debugger.cpp4
-rw-r--r--lib/Linker/Linker.cpp2
-rw-r--r--lib/VMCore/LLVMContext.cpp2
-rw-r--r--lib/VMCore/Module.cpp2
11 files changed, 19 insertions, 19 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 1a8b25ace25..bb5726293fe 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -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, const LLVMContext& C)
+Archive::Archive(const sys::Path& filename, 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,
- const LLVMContext& Context,
+ 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,
- const LLVMContext& Context,
+ LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
// Get the module provider
diff --git a/lib/Archive/ArchiveInternals.h b/lib/Archive/ArchiveInternals.h
index 15f01b3690e..d187ed91d72 100644
--- a/lib/Archive/ArchiveInternals.h
+++ b/lib/Archive/ArchiveInternals.h
@@ -73,13 +73,13 @@ namespace llvm {
// Get just the externally visible defined symbols from the bitcode
bool GetBitcodeSymbols(const sys::Path& fName,
- const LLVMContext& Context,
+ LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
ModuleProvider* GetBitcodeSymbols(const unsigned char*Buffer,unsigned Length,
const std::string& ModuleID,
- const LLVMContext& Context,
+ LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
}
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp
index 2393554ede8..718d44608b1 100644
--- a/lib/Archive/ArchiveReader.cpp
+++ b/lib/Archive/ArchiveReader.cpp
@@ -327,7 +327,7 @@ Archive::loadArchive(std::string* error) {
// Open and completely load the archive file.
Archive*
-Archive::OpenAndLoad(const sys::Path& file, const LLVMContext& C,
+Archive::OpenAndLoad(const sys::Path& file, LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C));
if (result->mapToMemory(ErrorMessage))
@@ -442,7 +442,7 @@ Archive::loadSymbolTable(std::string* ErrorMsg) {
// Open the archive and load just the symbol tables
Archive* Archive::OpenAndLoadSymbols(const sys::Path& file,
- const LLVMContext& C,
+ LLVMContext& C,
std::string* ErrorMessage) {
std::auto_ptr<Archive> result ( new Archive(file, C) );
if (result->mapToMemory(ErrorMessage))
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp
index e84035404bf..881d75b3ba8 100644
--- a/lib/Archive/ArchiveWriter.cpp
+++ b/lib/Archive/ArchiveWriter.cpp
@@ -64,7 +64,7 @@ static inline unsigned numVbrBytes(unsigned num) {
}
// Create an empty archive.
-Archive* Archive::CreateEmpty(const sys::Path& FilePath, const LLVMContext& C) {
+Archive* Archive::CreateEmpty(const sys::Path& FilePath, LLVMContext& C) {
Archive* result = new Archive(FilePath, C);
return result;
}
diff --git a/lib/AsmParser/Parser.cpp b/lib/AsmParser/Parser.cpp
index daf23fe748b..82d6f8fe5d4 100644
--- a/lib/AsmParser/Parser.cpp
+++ b/lib/AsmParser/Parser.cpp
@@ -21,7 +21,7 @@
using namespace llvm;
Module *llvm::ParseAssemblyFile(const std::string &Filename, ParseError &Err,
- const LLVMContext& Context) {
+ LLVMContext& Context) {
Err.setFilename(Filename);
std::string ErrorStr;
@@ -39,7 +39,7 @@ Module *llvm::ParseAssemblyFile(const std::string &Filename, ParseError &Err,
}
Module *llvm::ParseAssemblyString(const char *AsmString, Module *M,
- ParseError &Err, const LLVMContext& Context) {
+ ParseError &Err, LLVMContext& Context) {
Err.setFilename("<string>");
OwningPtr<MemoryBuffer>
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index ce33de04f7e..5943de2f812 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2090,7 +2090,7 @@ Module *BitcodeReader::releaseModule(std::string *ErrInfo) {
/// getBitcodeModuleProvider - lazy function-at-a-time loading from a file.
///
ModuleProvider *llvm::getBitcodeModuleProvider(MemoryBuffer *Buffer,
- const LLVMContext& Context,
+ LLVMContext& Context,
std::string *ErrMsg) {
BitcodeReader *R = new BitcodeReader(Buffer, Context);
if (R->ParseBitcode()) {
@@ -2107,7 +2107,7 @@ ModuleProvider *llvm::getBitcodeModuleProvider(MemoryBuffer *Buffer,
/// ParseBitcodeFile - Read the specified bitcode file, returning the module.
/// If an error occurs, return null and fill in *ErrMsg if non-null.
-Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, const LLVMContext& Context,
+Module *llvm::ParseBitcodeFile(MemoryBuffer *Buffer, LLVMContext& Context,
std::string *ErrMsg){
BitcodeReader *R;
R = static_cast<BitcodeReader*>(getBitcodeModuleProvider(Buffer, Context,
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/Reader/BitcodeReader.h
index dd12375cc43..662631bce95 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/Reader/BitcodeReader.h
@@ -86,7 +86,7 @@ public:
};
class BitcodeReader : public ModuleProvider {
- const LLVMContext& Context;
+ LLVMContext& Context;
MemoryBuffer *Buffer;
BitstreamReader StreamFile;
BitstreamCursor Stream;
@@ -125,7 +125,7 @@ class BitcodeReader : public ModuleProvider {
/// stream) and what linkage the original function had.
DenseMap<Function*, std::pair<uint64_t, unsigned> > DeferredFunctionInfo;
public:
- explicit BitcodeReader(MemoryBuffer *buffer, const LLVMContext& C)
+ explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext& C)
: Context(C), Buffer(buffer), ErrorString(0) {
HasReversedFunctionsWithBodies = false;
}
diff --git a/lib/Debugger/Debugger.cpp b/lib/Debugger/Debugger.cpp
index 61d8358d08d..77fd2ac96be 100644
--- a/lib/Debugger/Debugger.cpp
+++ b/lib/Debugger/Debugger.cpp
@@ -47,7 +47,7 @@ std::string Debugger::getProgramPath() const {
static Module *
getMaterializedModuleProvider(const std::string &Filename,
- const LLVMContext& C) {
+ LLVMContext& C) {
std::auto_ptr<MemoryBuffer> Buffer;
Buffer.reset(MemoryBuffer::getFileOrSTDIN(Filename.c_str()));
if (Buffer.get())
@@ -59,7 +59,7 @@ getMaterializedModuleProvider(const std::string &Filename,
/// the PATH for the specified program, loading it when found. If the
/// specified program cannot be found, an exception is thrown to indicate the
/// error.
-void Debugger::loadProgram(const std::string &Filename, const LLVMContext& C) {
+void Debugger::loadProgram(const std::string &Filename, LLVMContext& C) {
if ((Program = getMaterializedModuleProvider(Filename, C)) ||
(Program = getMaterializedModuleProvider(Filename+".bc", C)))
return; // Successfully loaded the program.
diff --git a/lib/Linker/Linker.cpp b/lib/Linker/Linker.cpp
index 42d4e724db4..6e0b760b85d 100644
--- a/lib/Linker/Linker.cpp
+++ b/lib/Linker/Linker.cpp
@@ -20,7 +20,7 @@
using namespace llvm;
Linker::Linker(const std::string& progname, const std::string& modname,
- const LLVMContext& C, unsigned flags):
+ LLVMContext& C, unsigned flags):
Context(C),
Composite(new Module(modname, C)),
LibPaths(),
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index d29b758ea74..24df598279b 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -22,7 +22,7 @@ using namespace llvm;
static ManagedStatic<LLVMContext> GlobalContext;
-const LLVMContext& llvm::getGlobalContext() {
+LLVMContext& llvm::getGlobalContext() {
return *GlobalContext;
}
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index 5ccd7ccfa35..f057e81a649 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/VMCore/Module.cpp
@@ -55,7 +55,7 @@ template class SymbolTableListTraits<GlobalAlias, Module>;
// Primitive Module methods.
//
-Module::Module(const std::string &MID, const LLVMContext& C)
+Module::Module(const std::string &MID, LLVMContext& C)
: Context(C), ModuleID(MID), DataLayout("") {
ValSymTab = new ValueSymbolTable();
TypeSymTab = new TypeSymbolTable();