summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/LTO/LTOCodeGenerator.h10
-rw-r--r--include/llvm/Transforms/IPO.h9
2 files changed, 17 insertions, 2 deletions
diff --git a/include/llvm/LTO/LTOCodeGenerator.h b/include/llvm/LTO/LTOCodeGenerator.h
index 04d18fd157..defea4f7ca 100644
--- a/include/llvm/LTO/LTOCodeGenerator.h
+++ b/include/llvm/LTO/LTOCodeGenerator.h
@@ -70,6 +70,7 @@ struct LTOCodeGenerator {
void setTargetOptions(llvm::TargetOptions options);
void setDebugInfo(lto_debug_model);
void setCodePICModel(lto_codegen_model);
+ void setInternalizeStrategy(lto_internalize_strategy);
void setCpu(const char *mCpu) { MCpu = mCpu; }
@@ -114,6 +115,14 @@ struct LTOCodeGenerator {
bool disableGVNLoadPRE,
std::string &errMsg);
+ bool shouldInternalize() const {
+ return InternalizeStrategy != LTO_INTERNALIZE_NONE;
+ }
+
+ bool shouldOnlyInternalizeHidden() const {
+ return InternalizeStrategy == LTO_INTERNALIZE_HIDDEN;
+ }
+
private:
void initializeLTOPasses();
@@ -138,6 +147,7 @@ private:
bool EmitDwarfDebugInfo;
bool ScopeRestrictionsDone;
lto_codegen_model CodeModel;
+ lto_internalize_strategy InternalizeStrategy;
StringSet MustPreserveSymbols;
StringSet AsmUndefinedRefs;
llvm::MemoryBuffer *NativeObjectFile;
diff --git a/include/llvm/Transforms/IPO.h b/include/llvm/Transforms/IPO.h
index 7f51c516b9..b4f65b25d5 100644
--- a/include/llvm/Transforms/IPO.h
+++ b/include/llvm/Transforms/IPO.h
@@ -108,14 +108,19 @@ Pass *createPruneEHPass();
////
/// The symbols in \p ExportList are never internalized.
///
+/// When OnlyHidden=true, only symbols with hidden visibility are internalized.
+///
/// 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(ArrayRef<const char *> ExportList,
+ bool OnlyHidden = false);
/// createInternalizePass - Same as above, but with an empty exportList.
-ModulePass *createInternalizePass();
+ModulePass *createInternalizePass(bool OnlyHidden = false);
+/// createInternalizePass - Resolve ambiguity when passed a const char *.
+ModulePass *createInternalizePass(const char *SingleExport);
//===----------------------------------------------------------------------===//
/// createDeadArgEliminationPass - This pass removes arguments from functions