Add const qualifier for FunctionInfoIndex in ModuleLinker and linkInModule() (NFC)
authorMehdi Amini <mehdi.amini@apple.com>
Mon, 23 Nov 2015 01:59:16 +0000 (01:59 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Mon, 23 Nov 2015 01:59:16 +0000 (01:59 +0000)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253840 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Linker/Linker.h
lib/Linker/LinkModules.cpp

index 679e60582e807a01c11402c2438ee6b8a1146049..610b1ddf9893b888a7aa98ff784b288cea86d0a8 100644 (file)
@@ -82,7 +82,7 @@ public:
   /// function is imported from the source module.
   /// Returns true on error.
   bool linkInModule(Module *Src, unsigned Flags = Flags::None,
   /// function is imported from the source module.
   /// Returns true on error.
   bool linkInModule(Module *Src, unsigned Flags = Flags::None,
-                    FunctionInfoIndex *Index = nullptr,
+                    const FunctionInfoIndex *Index = nullptr,
                     Function *FuncToImport = nullptr);
 
   /// \brief Set the composite to the passed-in module.
                     Function *FuncToImport = nullptr);
 
   /// \brief Set the composite to the passed-in module.
index 7649d13929f442fa07914a40c6738b991eca48f8..f97bbe5a8e50ecd267446101e3f302d7a68c6d39 100644 (file)
@@ -428,7 +428,7 @@ class ModuleLinker {
 
   /// Function index passed into ModuleLinker for using in function
   /// importing/exporting handling.
 
   /// Function index passed into ModuleLinker for using in function
   /// importing/exporting handling.
-  FunctionInfoIndex *ImportIndex;
+  const FunctionInfoIndex *ImportIndex;
 
   /// Function to import from source module, all other functions are
   /// imported as declarations instead of definitions.
 
   /// Function to import from source module, all other functions are
   /// imported as declarations instead of definitions.
@@ -448,7 +448,7 @@ class ModuleLinker {
 public:
   ModuleLinker(Module *dstM, Linker::IdentifiedStructTypeSet &Set, Module *srcM,
                DiagnosticHandlerFunction DiagnosticHandler, unsigned Flags,
 public:
   ModuleLinker(Module *dstM, Linker::IdentifiedStructTypeSet &Set, Module *srcM,
                DiagnosticHandlerFunction DiagnosticHandler, unsigned Flags,
-               FunctionInfoIndex *Index = nullptr,
+               const FunctionInfoIndex *Index = nullptr,
                Function *FuncToImport = nullptr)
       : DstM(dstM), SrcM(srcM), TypeMap(Set),
         ValMaterializer(TypeMap, DstM, LazilyLinkGlobalValues, this),
                Function *FuncToImport = nullptr)
       : DstM(dstM), SrcM(srcM), TypeMap(Set),
         ValMaterializer(TypeMap, DstM, LazilyLinkGlobalValues, this),
@@ -2088,7 +2088,8 @@ void Linker::deleteModule() {
   Composite = nullptr;
 }
 
   Composite = nullptr;
 }
 
-bool Linker::linkInModule(Module *Src, unsigned Flags, FunctionInfoIndex *Index,
+bool Linker::linkInModule(Module *Src, unsigned Flags,
+                          const FunctionInfoIndex *Index,
                           Function *FuncToImport) {
   ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src,
                          DiagnosticHandler, Flags, Index, FuncToImport);
                           Function *FuncToImport) {
   ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src,
                          DiagnosticHandler, Flags, Index, FuncToImport);