diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
tree | 4def12e759965de927d963ac65840d663ef9d1ea /include/llvm/Transforms/IPO.h | |
parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) |
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. |