From: Teresa Johnson Date: Wed, 9 Dec 2015 19:39:47 +0000 (+0000) Subject: [ThinLTO] FunctionImport pass can take a const index pointer (NFC) X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fbc5640b6bbb679dc78d1e563b3283bcc1036205;p=oota-llvm.git [ThinLTO] FunctionImport pass can take a const index pointer (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255140 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Transforms/IPO.h b/include/llvm/Transforms/IPO.h index 04032d3b328..38b8ffdd9fc 100644 --- a/include/llvm/Transforms/IPO.h +++ b/include/llvm/Transforms/IPO.h @@ -88,7 +88,7 @@ ModulePass *createGVExtractionPass(std::vector& GVs, bool //===----------------------------------------------------------------------===// /// This pass performs iterative function importing from other modules. -Pass *createFunctionImportPass(FunctionInfoIndex *Index = nullptr); +Pass *createFunctionImportPass(const FunctionInfoIndex *Index = nullptr); //===----------------------------------------------------------------------===// /// createFunctionInliningPass - Return a new pass object that uses a heuristic diff --git a/include/llvm/Transforms/IPO/PassManagerBuilder.h b/include/llvm/Transforms/IPO/PassManagerBuilder.h index 70b785f9efa..a4e7bce8ef4 100644 --- a/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -117,7 +117,7 @@ public: Pass *Inliner; /// The function summary index to use for function importing. - FunctionInfoIndex *FunctionIndex; + const FunctionInfoIndex *FunctionIndex; bool DisableTailCalls; bool DisableUnitAtATime; diff --git a/lib/Transforms/IPO/FunctionImport.cpp b/lib/Transforms/IPO/FunctionImport.cpp index c6a70381e76..c9874fc3714 100644 --- a/lib/Transforms/IPO/FunctionImport.cpp +++ b/lib/Transforms/IPO/FunctionImport.cpp @@ -344,7 +344,7 @@ getFunctionIndexForFile(StringRef Path, std::string &Error, class FunctionImportPass : public ModulePass { /// Optional function summary index to use for importing, otherwise /// the summary-file option must be specified. - FunctionInfoIndex *Index; + const FunctionInfoIndex *Index; public: /// Pass identification, replacement for typeid @@ -355,7 +355,7 @@ public: return "Function Importing"; } - explicit FunctionImportPass(FunctionInfoIndex *Index = nullptr) + explicit FunctionImportPass(const FunctionInfoIndex *Index = nullptr) : ModulePass(ID), Index(Index) {} bool runOnModule(Module &M) override { @@ -394,7 +394,7 @@ INITIALIZE_PASS_END(FunctionImportPass, "function-import", "Summary Based Function Import", false, false) namespace llvm { -Pass *createFunctionImportPass(FunctionInfoIndex *Index = nullptr) { +Pass *createFunctionImportPass(const FunctionInfoIndex *Index = nullptr) { return new FunctionImportPass(Index); } }