[ThinLTO] FunctionImport pass can take a const index pointer (NFC)
authorTeresa Johnson <tejohnson@google.com>
Wed, 9 Dec 2015 19:39:47 +0000 (19:39 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 9 Dec 2015 19:39:47 +0000 (19:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255140 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/IPO.h
include/llvm/Transforms/IPO/PassManagerBuilder.h
lib/Transforms/IPO/FunctionImport.cpp

index 04032d3b328a62f77c4e8453df2b6d0e908ad3ee..38b8ffdd9fc97871ad1d66a2ae6fb4a3b4f057c1 100644 (file)
@@ -88,7 +88,7 @@ ModulePass *createGVExtractionPass(std::vector<GlobalValue*>& GVs, bool
 
 //===----------------------------------------------------------------------===//
 /// This pass performs iterative function importing from other modules.
 
 //===----------------------------------------------------------------------===//
 /// 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
 
 //===----------------------------------------------------------------------===//
 /// createFunctionInliningPass - Return a new pass object that uses a heuristic
index 70b785f9efa358a38e8a2a99c6e6221f0553653b..a4e7bce8ef4ae54af1db7b509d6c050eabb30c28 100644 (file)
@@ -117,7 +117,7 @@ public:
   Pass *Inliner;
 
   /// The function summary index to use for function importing.
   Pass *Inliner;
 
   /// The function summary index to use for function importing.
-  FunctionInfoIndex *FunctionIndex;
+  const FunctionInfoIndex *FunctionIndex;
 
   bool DisableTailCalls;
   bool DisableUnitAtATime;
 
   bool DisableTailCalls;
   bool DisableUnitAtATime;
index c6a70381e76cf74d38cc7873f04e1732dab3c686..c9874fc371496aa091bcad484498a34fef96d186 100644 (file)
@@ -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.
 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
 
 public:
   /// Pass identification, replacement for typeid
@@ -355,7 +355,7 @@ public:
     return "Function Importing";
   }
 
     return "Function Importing";
   }
 
-  explicit FunctionImportPass(FunctionInfoIndex *Index = nullptr)
+  explicit FunctionImportPass(const FunctionInfoIndex *Index = nullptr)
       : ModulePass(ID), Index(Index) {}
 
   bool runOnModule(Module &M) override {
       : 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 {
                     "Summary Based Function Import", false, false)
 
 namespace llvm {
-Pass *createFunctionImportPass(FunctionInfoIndex *Index = nullptr) {
+Pass *createFunctionImportPass(const FunctionInfoIndex *Index = nullptr) {
   return new FunctionImportPass(Index);
 }
 }
   return new FunctionImportPass(Index);
 }
 }