summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPedro Artigas <partigas@apple.com>2013-01-25 19:41:03 +0000
committerPedro Artigas <partigas@apple.com>2013-01-25 19:41:03 +0000
commit3f16858579fdf7ee1cc6823736c68cede6643da1 (patch)
tree4cf7c276c471e457c2e74b07fedce72d95f5856b /lib
parent7e4aeba9f3007e601f2a53fc295b481d7762516d (diff)
downloadllvm-3f16858579fdf7ee1cc6823736c68cede6643da1.tar.gz
llvm-3f16858579fdf7ee1cc6823736c68cede6643da1.tar.bz2
llvm-3f16858579fdf7ee1cc6823736c68cede6643da1.tar.xz
added ability to dynamically change the ExportList of an already
created InternalizePass (useful for pass reuse) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/IPO/Internalize.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index 70d55b0061..4bfab5b0af 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -50,6 +50,8 @@ namespace {
explicit InternalizePass();
explicit InternalizePass(ArrayRef<const char *> exportList);
void LoadFile(const char *Filename);
+ void ClearExportList();
+ void AddToExportList(const std::string &val);
virtual bool runOnModule(Module &M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
@@ -97,6 +99,14 @@ void InternalizePass::LoadFile(const char *Filename) {
}
}
+void InternalizePass::ClearExportList() {
+ ExternalNames.clear();
+}
+
+void InternalizePass::AddToExportList(const std::string &val) {
+ ExternalNames.insert(val);
+}
+
bool InternalizePass::runOnModule(Module &M) {
CallGraph *CG = getAnalysisIfAvailable<CallGraph>();
CallGraphNode *ExternalNode = CG ? CG->getExternalCallingNode() : 0;