aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/IPO/StripSymbols.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-08-03 00:30:35 +0000
committerBill Wendling <isanbard@gmail.com>2012-08-03 00:30:35 +0000
commit573e97326766359d3a9747eed7b7d47b6c33fa0f (patch)
tree673f5f53704610e9160435ff0d435e8b8e600524 /lib/Transforms/IPO/StripSymbols.cpp
parente94ac8871a1ac79bece57335d2abece0feed9c02 (diff)
downloadexternal_llvm-573e97326766359d3a9747eed7b7d47b6c33fa0f.zip
external_llvm-573e97326766359d3a9747eed7b7d47b6c33fa0f.tar.gz
external_llvm-573e97326766359d3a9747eed7b7d47b6c33fa0f.tar.bz2
Move the "findUsedStructTypes" functionality outside of the Module class.
The "findUsedStructTypes" method is very expensive to run. It needs to be optimized so that LTO can run faster. Splitting this method out of the Module class will help this occur. For instance, it can keep a list of seen objects so that it doesn't process them over and over again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/StripSymbols.cpp')
-rw-r--r--lib/Transforms/IPO/StripSymbols.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp
index d8e8cf7..80bfc1c 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -27,6 +27,7 @@
#include "llvm/Instructions.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
+#include "llvm/TypeFinder.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/ADT/DenseMap.h"
@@ -175,8 +176,8 @@ static void StripSymtab(ValueSymbolTable &ST, bool PreserveDbgInfo) {
// Strip any named types of their names.
static void StripTypeNames(Module &M, bool PreserveDbgInfo) {
- std::vector<StructType*> StructTypes;
- M.findUsedStructTypes(StructTypes);
+ TypeFinder StructTypes;
+ StructTypes.run(M, false);
for (unsigned i = 0, e = StructTypes.size(); i != e; ++i) {
StructType *STy = StructTypes[i];