From: Mehdi Amini Date: Thu, 3 Dec 2015 02:37:30 +0000 (+0000) Subject: Adapt comment and rename variable in ModuleLinker to describe more accurately the... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8466beff264684e6b6c354a569a3c8a3ecb22490;p=oota-llvm.git Adapt comment and rename variable in ModuleLinker to describe more accurately the actual use. Thanks Sean Silva for the suggestion. From: Mehdi Amini git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254582 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Linker/Linker.h b/include/llvm/Linker/Linker.h index 7c24eef7411..0c7dc910a65 100644 --- a/include/llvm/Linker/Linker.h +++ b/include/llvm/Linker/Linker.h @@ -74,15 +74,17 @@ public: Module &getModule() const { return Composite; } /// \brief Link \p Src into the composite. The source is destroyed. + /// /// Passing OverrideSymbols as true will have symbols from Src /// shadow those in the Dest. /// For ThinLTO function importing/exporting the \p FunctionInfoIndex - /// is passed. If a \p FuncToImport is provided, only that single - /// function is imported from the source module. + /// is passed. If \p FunctionsToImport is provided, only the functions that + /// are part of the set will be imported from the source module. + /// /// Returns true on error. bool linkInModule(Module &Src, unsigned Flags = Flags::None, const FunctionInfoIndex *Index = nullptr, - DenseSet *FuncToImport = nullptr); + DenseSet *FunctionsToImport = nullptr); static bool linkModules(Module &Dest, Module &Src, DiagnosticHandlerFunction DiagnosticHandler, diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 4f740587272..67613967f49 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -424,10 +424,10 @@ public: ModuleLinker(Module &DstM, Linker::IdentifiedStructTypeSet &Set, Module &SrcM, DiagnosticHandlerFunction DiagnosticHandler, unsigned Flags, const FunctionInfoIndex *Index = nullptr, - DenseSet *FuncToImport = nullptr) + DenseSet *FunctionsToImport = nullptr) : DstM(DstM), SrcM(SrcM), TypeMap(Set), ValMaterializer(this), DiagnosticHandler(DiagnosticHandler), Flags(Flags), ImportIndex(Index), - ImportFunction(FuncToImport) { + ImportFunction(FunctionsToImport) { assert((ImportIndex || !ImportFunction) && "Expect a FunctionInfoIndex when importing"); // If we have a FunctionInfoIndex but no function to import, @@ -2031,9 +2031,9 @@ Linker::Linker(Module &M) bool Linker::linkInModule(Module &Src, unsigned Flags, const FunctionInfoIndex *Index, - DenseSet *FuncToImport) { + DenseSet *FunctionsToImport) { ModuleLinker TheLinker(Composite, IdentifiedStructTypes, Src, - DiagnosticHandler, Flags, Index, FuncToImport); + DiagnosticHandler, Flags, Index, FunctionsToImport); bool RetCode = TheLinker.run(); Composite.dropTriviallyDeadConstantArrays(); return RetCode;