added ability to dynamically change the ExportList of an already
authorPedro Artigas <partigas@apple.com>
Fri, 25 Jan 2013 19:41:03 +0000 (19:41 +0000)
committerPedro Artigas <partigas@apple.com>
Fri, 25 Jan 2013 19:41:03 +0000 (19:41 +0000)
created InternalizePass (useful for pass reuse)

llvm-svn: 173474

llvm/lib/Transforms/IPO/Internalize.cpp

index 70d55b0..4bfab5b 100644 (file)
@@ -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;