diff --git a/llvm/include/llvm/Linker/Linker.h b/llvm/include/llvm/Linker/Linker.h index 679e60582e80..610b1ddf9893 100644 --- a/llvm/include/llvm/Linker/Linker.h +++ b/llvm/include/llvm/Linker/Linker.h @@ -82,7 +82,7 @@ public: /// 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. diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index 7649d13929f4..f97bbe5a8e50 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -428,7 +428,7 @@ class ModuleLinker { /// 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. @@ -448,7 +448,7 @@ class ModuleLinker { 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), @@ -2088,7 +2088,8 @@ void Linker::deleteModule() { 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);