Make the use of const with respect to LLVMContext sane. Hopefully this is the last...
authorOwen Anderson <resistor@mac.com>
Wed, 1 Jul 2009 23:13:44 +0000 (23:13 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 1 Jul 2009 23:13:44 +0000 (23:13 +0000)
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

29 files changed:
examples/BrainF/BrainF.cpp
examples/BrainF/BrainF.h
include/llvm/Assembly/Parser.h
include/llvm/Bitcode/Archive.h
include/llvm/Bitcode/ReaderWriter.h
include/llvm/Debugger/Debugger.h
include/llvm/LLVMContext.h
include/llvm/Linker.h
include/llvm/Module.h
lib/Archive/Archive.cpp
lib/Archive/ArchiveInternals.h
lib/Archive/ArchiveReader.cpp
lib/Archive/ArchiveWriter.cpp
lib/AsmParser/Parser.cpp
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Reader/BitcodeReader.h
lib/Debugger/Debugger.cpp
lib/Linker/Linker.cpp
lib/VMCore/LLVMContext.cpp
lib/VMCore/Module.cpp
tools/bugpoint/BugDriver.cpp
tools/bugpoint/BugDriver.h
tools/llvm-db/CLIDebugger.cpp
tools/llvm-db/CLIDebugger.h
tools/llvm-link/llvm-link.cpp
tools/lto/LTOCodeGenerator.cpp
tools/lto/LTOCodeGenerator.h
tools/lto/LTOModule.cpp
tools/lto/LTOModule.h

index fa6d6675e77d4626853db877f0bb8c87d98aaf58..d3261d79965cc09f4da5cae40c38fdbcce006eec 100644 (file)
@@ -37,7 +37,7 @@ const char *BrainF::label   = "brainf";
 const char *BrainF::testreg = "test";
 
 Module *BrainF::parse(std::istream *in1, int mem, CompileFlags cf,
-                      const LLVMContext& Context) {
+                      LLVMContext& Context) {
   in       = in1;
   memtotal = mem;
   comflag  = cf;
@@ -48,7 +48,7 @@ Module *BrainF::parse(std::istream *in1, int mem, CompileFlags cf,
   return module;
 }
 
-void BrainF::header(const LLVMContext& C) {
+void BrainF::header(LLVMContext& C) {
   module = new Module("BrainF", C);
 
   //Function prototypes
index d21d3bb8913923f763cb4ef897b5b8dbe513ee1f..053ddaa58755415f8823693371134b3454368d19 100644 (file)
@@ -40,7 +40,7 @@ class BrainF {
     /// On error, it calls abort.
     /// The caller must delete the returned module.
     Module *parse(std::istream *in1, int mem, CompileFlags cf,
-                  const LLVMContext& C);
+                  LLVMContext& C);
 
   protected:
     /// The different symbols in the BrainF language
@@ -66,7 +66,7 @@ class BrainF {
     static const char *testreg;
 
     /// Put the brainf function preamble and other fixed pieces of code
-    void header(const LLVMContext& C);
+    void header(LLVMContext& C);
 
     /// The main loop for parsing.  It calls itself recursively
     /// to handle the depth of nesting of "[]".
index 616750ae3ef3e8bb966a75c4a43a516bc2dc6bf6..3f601493b0a14b72f9ccf4c32d12f7e246a40b03 100644 (file)
@@ -32,7 +32,7 @@ class LLVMContext;
 Module *ParseAssemblyFile(
   const std::string &Filename, ///< The name of the file to parse
   ParseError &Error,           ///< If not null, an object to return errors in.
-  const LLVMContext& Context         ///< Context in which to allocate globals info.
+  LLVMContext& Context         ///< Context in which to allocate globals info.
 );
 
 /// The function is a secondary interface to the LLVM Assembly Parser. It parses
@@ -45,7 +45,7 @@ Module *ParseAssemblyString(
   const char *AsmString, ///< The string containing assembly
   Module *M,             ///< A module to add the assembly too.
   ParseError &Error,     ///< If not null, an object to return errors in.
-  const LLVMContext& Context
+  LLVMContext& Context
 );
 
 //===------------------------------------------------------------------------===
index 85b918ed32e40875b9b314732c5b54cfb8dd9444..13583c0d5ecd6901354c50d37eb47a6931620a40 100644 (file)
@@ -280,7 +280,7 @@ class Archive {
     /// @brief Create an empty Archive.
     static Archive* CreateEmpty(
       const sys::Path& Filename,///< Name of the archive to (eventually) create.
-      const LLVMContext& C            ///< Context to use for global information
+      LLVMContext& C            ///< Context to use for global information
     );
 
     /// Open an existing archive and load its contents in preparation for
@@ -291,7 +291,7 @@ class Archive {
     /// @brief Open and load an archive file
     static Archive* OpenAndLoad(
       const sys::Path& filePath,  ///< The file path to open and load
-      const LLVMContext& C,       ///< The context to use for global information
+      LLVMContext& C,       ///< The context to use for global information
       std::string* ErrorMessage   ///< An optional error string
     );
 
@@ -313,7 +313,7 @@ class Archive {
     /// @brief Open an existing archive and load its symbols.
     static Archive* OpenAndLoadSymbols(
       const sys::Path& Filename,   ///< Name of the archive file to open
-      const LLVMContext& C,              ///< The context to use for global info
+      LLVMContext& C,              ///< The context to use for global info
       std::string* ErrorMessage=0  ///< An optional error string
     );
 
@@ -453,7 +453,7 @@ class Archive {
   protected:
     /// @brief Construct an Archive for \p filename and optionally  map it
     /// into memory.
-    explicit Archive(const sys::Path& filename, const LLVMContext& C);
+    explicit Archive(const sys::Path& filename, LLVMContext& C);
 
     /// @param data The symbol table data to be parsed
     /// @param len  The length of the symbol table data
@@ -534,7 +534,7 @@ class Archive {
     unsigned firstFileOffset; ///< Offset to first normal file.
     ModuleMap modules;        ///< The modules loaded via symbol lookup.
     ArchiveMember* foreignST; ///< This holds the foreign symbol table.
-    const LLVMContext& Context;     ///< This holds global data.
+    LLVMContext& Context;     ///< This holds global data.
   /// @}
   /// @name Hidden
   /// @{
index 3cde47bf77e8822018249b51e103a19ece3e67dc..3d33d75a06a199400d851c5bb5f290deddf144e9 100644 (file)
@@ -32,13 +32,13 @@ namespace llvm {
   /// error, this returns null, *does not* take ownership of Buffer, and fills
   /// in *ErrMsg with an error description if ErrMsg is non-null.
   ModuleProvider *getBitcodeModuleProvider(MemoryBuffer *Buffer,
-                                           const LLVMContext& Context,
+                                           LLVMContext& Context,
                                            std::string *ErrMsg = 0);
 
   /// ParseBitcodeFile - Read the specified bitcode file, returning the module.
   /// If an error occurs, this returns null and fills in *ErrMsg if it is
   /// non-null.  This method *never* takes ownership of Buffer.
-  Module *ParseBitcodeFile(MemoryBuffer *Buffer, const LLVMContext& Context,
+  Module *ParseBitcodeFile(MemoryBuffer *Buffer, LLVMContext& Context,
                            std::string *ErrMsg = 0);
 
   /// WriteBitcodeToFile - Write the specified module to the specified output
index d003539e7e2e1ba48c3c849677735c5cfb23df40..42de35660c265fa489f9aa54dce6d7d49e4ab646 100644 (file)
@@ -96,7 +96,7 @@ namespace llvm {
     /// 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 loadProgram(const std::string &Path, const LLVMContext& Context);
+    void loadProgram(const std::string &Path, LLVMContext& Context);
 
     /// unloadProgram - If a program is running, kill it, then unload all traces
     /// of the current program.  If no program is loaded, this method silently
index f0c2200c7a3ddcc8141546d70032fe24eb1b4048..f018b7e428636abb3269492d0d365a6db4f866e2 100644 (file)
@@ -198,7 +198,7 @@ public:
 };
 
 /// FOR BACKWARDS COMPATIBILITY - Returns a global context.
-extern const LLVMContext& getGlobalContext();
+extern LLVMContext& getGlobalContext();
 
 }
 
index 2ab0ed4705915731c098c20be9f66d17ff74b88c..2d0c2cd96b76473369afe8d9c8ebae30ccea257f 100644 (file)
@@ -67,7 +67,7 @@ class Linker {
     Linker(
         const std::string& progname, ///< name of tool running linker
         const std::string& modulename, ///< name of linker's end-result module
-        const LLVMContext& C, ///< Context for global info
+        LLVMContext& C, ///< Context for global info
         unsigned Flags = 0  ///< ControlFlags (one or more |'d together)
     );
 
@@ -285,7 +285,7 @@ class Linker {
   /// @name Data
   /// @{
   private:
-    const LLVMContext& Context; ///< The context for global information
+    LLVMContext& Context; ///< The context for global information
     Module* Composite; ///< The composite module linked together
     std::vector<sys::Path> LibPaths; ///< The library search paths
     unsigned Flags;    ///< Flags to control optional behavior.
index 8efa8e0e0eb1fa39bd3b592d65d34871f59f4d02..7a139cc1e0a92638daf8312e9b74a668c100b3b2 100644 (file)
@@ -110,7 +110,7 @@ public:
 /// @name Member Variables
 /// @{
 private:
-  const LLVMContext& Context;    ///< The LLVMContext from which types and
+  LLVMContext& Context;    ///< The LLVMContext from which types and
                                  ///< constants are allocated.
   GlobalListType GlobalList;     ///< The Global Variables in the module
   FunctionListType FunctionList; ///< The Functions in the module
@@ -131,7 +131,7 @@ private:
 public:
   /// The Module constructor. Note that there is no default constructor. You
   /// must provide a name for the module upon construction.
-  explicit Module(const std::string &ModuleID, const LLVMContext& C);
+  explicit Module(const std::string &ModuleID, LLVMContext& C);
   /// The module destructor. This will dropAllReferences.
   ~Module();
 
@@ -162,7 +162,7 @@ public:
 
   /// Get the global data context.
   /// @returns LLVMContext - a container for LLVM's global information
-  const LLVMContext& getContext() const { return Context; }
+  LLVMContext& getContext() const { return Context; }
 
   /// Get any module-scope inline assembly blocks.
   /// @returns a string containing the module-scope inline assembly blocks.
index 1a8b25ace254d40451b549aef70f4d199651a232..bb5726293fe4bb287773c498b1cca08523c5ad17 100644 (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, 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
index 15f01b3690e9f430ffda3a086dde7c481587ffd2..d187ed91d724625597ac91c1e9a074305671516c 100644 (file)
@@ -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);
 }
index 2393554ede8f1ef33441e18152935d30ff1c8f2e..718d44608b1d262db4363bffc357ea111b3c2db5 100644 (file)
@@ -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))
index e84035404bf3564efecc4e4350002d8719b92b5c..881d75b3ba8fa8a00486bf32b6cc786eba7a83df 100644 (file)
@@ -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;
 }
index daf23fe748b73115970d2228678b212538844483..82d6f8fe5d4e02037b1765af7421e48797fc2fbd 100644 (file)
@@ -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>
index ce33de04f7ebfc026b18cbd665c973a73453797f..5943de2f81210a718e4be89d32150a4b8f2e737e 100644 (file)
@@ -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, 
index dd12375cc432c578ffcd7588ef08673ff9a8060f..662631bce950748a0f9248be1de83ccc8b5a7b6b 100644 (file)
@@ -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;
   }
index 61d8358d08d57a8d6a312fa35c2e25db2c69d040..77fd2ac96bea03ecaced4f74cebedccca08da951 100644 (file)
@@ -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.
index 42d4e724db49da5c05ae556b04dafb30b2944c0b..6e0b760b85def5b0821bc4ebc02f7eae575aa220 100644 (file)
@@ -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(),
index d29b758ea74c4b766a6e465686856cc06252e82a..24df598279bab71b0e20928a48e10f05dfaf95d0 100644 (file)
@@ -22,7 +22,7 @@ using namespace llvm;
 
 static ManagedStatic<LLVMContext> GlobalContext;
 
-const LLVMContext& llvm::getGlobalContext() {
+LLVMContext& llvm::getGlobalContext() {
   return *GlobalContext;
 }
 
index 5ccd7ccfa35bdc92bbbe7cdc25d3b49983660d12..f057e81a649bf0b3d3e2f27a715cd955b0c6c6ac 100644 (file)
@@ -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();
index 93b09fb381c5fdd2b9ecf9b231bbbbde23661f1f..847de1f806644f59a6aae387d13a3f2e062d5db5 100644 (file)
@@ -65,7 +65,7 @@ std::string llvm::getPassesString(const std::vector<const PassInfo*> &Passes) {
 
 BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs,
                      unsigned timeout, unsigned memlimit,
-                     const LLVMContext& ctxt)
+                     LLVMContext& ctxt)
   : Context(ctxt), ToolName(toolname), ReferenceOutputFile(OutputFile),
     Program(0), Interpreter(0), SafeInterpreter(0), gcc(0),
     run_as_child(as_child), run_find_bugs(find_bugs), Timeout(timeout), 
@@ -76,7 +76,7 @@ BugDriver::BugDriver(const char *toolname, bool as_child, bool find_bugs,
 /// return it, or return null if not possible.
 ///
 Module *llvm::ParseInputFile(const std::string &Filename,
-                             const LLVMContext& Ctxt) {
+                             LLVMContext& Ctxt) {
   std::auto_ptr<MemoryBuffer> Buffer(MemoryBuffer::getFileOrSTDIN(Filename));
   Module *Result = 0;
   if (Buffer.get())
index 34267d55a628133006f52df69a214f553785e631..d637c2438bf9df7466a0ad2cf42e8ea97b310718 100644 (file)
@@ -43,7 +43,7 @@ extern bool DisableSimplifyCFG;
 extern bool BugpointIsInterrupted;
 
 class BugDriver {
-  const LLVMContext& Context;
+  LLVMContext& Context;
   const std::string ToolName;  // Name of bugpoint
   std::string ReferenceOutputFile; // Name of `good' output file
   Module *Program;             // The raw program, linked together
@@ -62,11 +62,11 @@ class BugDriver {
 
 public:
   BugDriver(const char *toolname, bool as_child, bool find_bugs,
-            unsigned timeout, unsigned memlimit, const LLVMContext& ctxt);
+            unsigned timeout, unsigned memlimit, LLVMContext& ctxt);
 
   const std::string &getToolName() const { return ToolName; }
 
-  const LLVMContext& getContext() { return Context; }
+  LLVMContext& getContext() { return Context; }
 
   // Set up methods... these methods are used to copy information about the
   // command line arguments into instance variables of BugDriver.
@@ -295,7 +295,7 @@ private:
 /// return it, or return null if not possible.
 ///
 Module *ParseInputFile(const std::string &InputFilename,
-                       const LLVMContext& ctxt);
+                       LLVMContext& ctxt);
 
 
 /// getPassesString - Turn a list of passes into a string which indicates the
index 3caa2e6bd53e58770e288c0d132fcb8f061770eb..31476f7d0b79b26b13e71aeef8770df1d0d536a3 100644 (file)
@@ -22,7 +22,7 @@ using namespace llvm;
 /// CLIDebugger constructor - This initializes the debugger to its default
 /// state, and initializes the command table.
 ///
-CLIDebugger::CLIDebugger(const LLVMContext& ctxt)
+CLIDebugger::CLIDebugger(LLVMContext& ctxt)
   : Context(ctxt), TheProgramInfo(0), TheRuntimeInfo(0),
     Prompt("(llvm-db) "), ListSize(10) {
   // Initialize instance variables
index a5c73bd86a0a0c618995eb86d5f558fbecacc4d6..99045592edf8a47efb934abd8c5f18dad0bee21f 100644 (file)
@@ -29,7 +29,7 @@ namespace llvm {
   /// CLIDebugger - This class implements the command line interface for the
   /// LLVM debugger.
   class CLIDebugger {
-    const LLVMContext& Context;
+    LLVMContext& Context;
     
     /// Dbg - The low-level LLVM debugger object that we use to do our dirty
     /// work.
@@ -82,7 +82,7 @@ namespace llvm {
     const SourceLanguage *CurrentLanguage;
 
   public:
-    CLIDebugger(const LLVMContext& ctxt);
+    CLIDebugger(LLVMContext& ctxt);
 
     /// getDebugger - Return the current LLVM debugger implementation being
     /// used.
index 818df14fd994da1c5304c1de60df7dbd64992ba7..f65e602f27f9c6ac40bbe23c65d11963ee8fe69b 100644 (file)
@@ -49,7 +49,7 @@ DumpAsm("d", cl::desc("Print assembly as linked"), cl::Hidden);
 // searches the link path for the specified file to try to find it...
 //
 static inline std::auto_ptr<Module> LoadFile(const std::string &FN, 
-                                             const LLVMContext& Context) {
+                                             LLVMContext& Context) {
   sys::Path Filename;
   if (!Filename.set(FN)) {
     cerr << "Invalid file name: '" << FN << "'\n";
index faac33b8caed382136eecb021de75fbabb702a63..6f5e6bc77133717f628a04a65a23a7b381da6741 100644 (file)
@@ -69,7 +69,7 @@ const char* LTOCodeGenerator::getVersionString()
 }
 
 
-LTOCodeGenerator::LTOCodeGenerator(const LLVMContext& Context) 
+LTOCodeGenerator::LTOCodeGenerator(LLVMContext& Context) 
     : _context(Context),
       _linker("LinkTimeOptimizer", "ld-temp.o", _context), _target(NULL),
       _emitDwarfDebugInfo(false), _scopeRestrictionsDone(false),
index 4603c35870da896342081158c46f43aa10db55ab..7b0c284d4efae2e8308b37acbbdf446628324e8a 100644 (file)
@@ -31,7 +31,7 @@ class LTOCodeGenerator {
 public:
     static const char*        getVersionString();
     
-                            LTOCodeGenerator(const llvm::LLVMContext& Context);
+                            LTOCodeGenerator(llvm::LLVMContext& Context);
                             ~LTOCodeGenerator();
                             
     bool                addModule(class LTOModule*, std::string& errMsg);
@@ -54,7 +54,7 @@ private:
     
     typedef llvm::StringMap<uint8_t> StringSet;
 
-    const llvm::LLVMContext&          _context;
+    llvm::LLVMContext&          _context;
     llvm::Linker                _linker;
     llvm::TargetMachine*        _target;
     bool                        _emitDwarfDebugInfo;
index 3da095d6c36cfb152a7a4a4a2e8341de9d31e719..157928c89447cf3c8a73cacb740e362187e88150 100644 (file)
@@ -87,7 +87,7 @@ LTOModule::LTOModule(Module* m, TargetMachine* t)
 }
 
 LTOModule* LTOModule::makeLTOModule(const char* path,
-                                    const LLVMContext& Context,
+                                    LLVMContext& Context,
                                     std::string& errMsg)
 {
     OwningPtr<MemoryBuffer> buffer(MemoryBuffer::getFile(path, &errMsg));
@@ -113,7 +113,7 @@ MemoryBuffer* LTOModule::makeBuffer(const void* mem, size_t length)
 
 
 LTOModule* LTOModule::makeLTOModule(const void* mem, size_t length, 
-                                    const LLVMContext& Context,
+                                    LLVMContext& Context,
                                     std::string& errMsg)
 {
     OwningPtr<MemoryBuffer> buffer(makeBuffer(mem, length));
@@ -142,7 +142,7 @@ std::string getFeatureString(const char *TargetTriple) {
 }
 
 LTOModule* LTOModule::makeLTOModule(MemoryBuffer* buffer,
-                                    const LLVMContext& Context,
+                                    LLVMContext& Context,
                                     std::string& errMsg)
 {
     // parse bitcode buffer
index d7b992f71d43b6a192b03c7d2f4f6f7a9747f5f2..367ad1026f012e2c605eeba3770ccbb68961bf40 100644 (file)
@@ -52,10 +52,10 @@ public:
                                                     const char* triplePrefix);
 
     static LTOModule*        makeLTOModule(const char* path,
-                                          const llvm::LLVMContext& Context,
+                                          llvm::LLVMContext& Context,
                                           std::string& errMsg);
     static LTOModule*        makeLTOModule(const void* mem, size_t length,
-                                           const llvm::LLVMContext& Context,
+                                           llvm::LLVMContext& Context,
                                            std::string& errMsg);
 
     const char*              getTargetTriple();
@@ -91,7 +91,7 @@ private:
                                                     const char* triplePrefix);
 
     static LTOModule*       makeLTOModule(llvm::MemoryBuffer* buffer,
-                                          const llvm::LLVMContext& Context,
+                                          llvm::LLVMContext& Context,
                                                         std::string& errMsg);
     static llvm::MemoryBuffer* makeBuffer(const void* mem, size_t length);