diff options
Diffstat (limited to 'include/llvm/Transforms/IPO.h')
-rw-r--r-- | include/llvm/Transforms/IPO.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/include/llvm/Transforms/IPO.h b/include/llvm/Transforms/IPO.h index 78d2fadc51900..f6731884870ce 100644 --- a/include/llvm/Transforms/IPO.h +++ b/include/llvm/Transforms/IPO.h @@ -15,12 +15,13 @@ #ifndef LLVM_TRANSFORMS_IPO_H #define LLVM_TRANSFORMS_IPO_H -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringRef.h" +#include <functional> +#include <vector> namespace llvm { -class FunctionInfoIndex; +class StringRef; +class ModuleSummaryIndex; class ModulePass; class Pass; class Function; @@ -88,7 +89,7 @@ ModulePass *createGVExtractionPass(std::vector<GlobalValue*>& GVs, bool //===----------------------------------------------------------------------===// /// This pass performs iterative function importing from other modules. -Pass *createFunctionImportPass(const FunctionInfoIndex *Index = nullptr); +Pass *createFunctionImportPass(const ModuleSummaryIndex *Index = nullptr); //===----------------------------------------------------------------------===// /// createFunctionInliningPass - Return a new pass object that uses a heuristic @@ -119,14 +120,17 @@ Pass *createPruneEHPass(); /// createInternalizePass - This pass loops over all of the functions in the /// input module, internalizing all globals (functions and variables) it can. //// -/// The symbols in \p ExportList are never internalized. +/// Before internalizing a symbol, the callback \p MustPreserveGV is invoked and +/// gives to the client the ability to prevent internalizing specific symbols. /// /// The symbol in DSOList are internalized if it is safe to drop them from /// the symbol table. /// /// Note that commandline options that are used with the above function are not /// used now! -ModulePass *createInternalizePass(ArrayRef<const char *> ExportList); +ModulePass * +createInternalizePass(std::function<bool(const GlobalValue &)> MustPreserveGV); + /// createInternalizePass - Same as above, but with an empty exportList. ModulePass *createInternalizePass(); @@ -183,15 +187,6 @@ ModulePass *createBlockExtractorPass(); ModulePass *createStripDeadPrototypesPass(); //===----------------------------------------------------------------------===// -/// createPostOrderFunctionAttrsPass - This pass walks SCCs of the call graph -/// in post-order to deduce and propagate function attributes. It can discover -/// functions that do not access memory, or only read memory, and give them the -/// readnone/readonly attribute. It also discovers function arguments that are -/// not captured by the function and marks them with the nocapture attribute. -/// -Pass *createPostOrderFunctionAttrsPass(); - -//===----------------------------------------------------------------------===// /// createReversePostOrderFunctionAttrsPass - This pass walks SCCs of the call /// graph in RPO to deduce and propagate function attributes. Currently it /// only handles synthesizing norecurse attributes. @@ -219,13 +214,17 @@ ModulePass *createMetaRenamerPass(); /// manager. ModulePass *createBarrierNoopPass(); -/// \brief This pass lowers bitset metadata and the llvm.bitset.test intrinsic -/// to bitsets. -ModulePass *createLowerBitSetsPass(); +/// \brief This pass lowers type metadata and the llvm.type.test intrinsic to +/// bitsets. +ModulePass *createLowerTypeTestsPass(); /// \brief This pass export CFI checks for use by external modules. ModulePass *createCrossDSOCFIPass(); +/// \brief This pass implements whole-program devirtualization using type +/// metadata. +ModulePass *createWholeProgramDevirtPass(); + //===----------------------------------------------------------------------===// // SampleProfilePass - Loads sample profile data from disk and generates // IR metadata to reflect the profile. |