diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-08-03 00:30:35 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-08-03 00:30:35 +0000 |
commit | 8555a37c04a8ebf14d52e548eccde1c237783079 (patch) | |
tree | c9aeeec67caaf89fa6efe0cecb7511ff2fdcc5ec /llvm/lib/VMCore/AsmWriter.cpp | |
parent | d15385c9e459feb4c5b83182c9b75f56df9519e9 (diff) | |
download | bcm5719-llvm-8555a37c04a8ebf14d52e548eccde1c237783079.tar.gz bcm5719-llvm-8555a37c04a8ebf14d52e548eccde1c237783079.zip |
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.
llvm-svn: 161228
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/VMCore/AsmWriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp index aedb86b3eed..7ef1131de19 100644 --- a/llvm/lib/VMCore/AsmWriter.cpp +++ b/llvm/lib/VMCore/AsmWriter.cpp @@ -26,6 +26,7 @@ #include "llvm/IntrinsicInst.h" #include "llvm/Operator.h" #include "llvm/Module.h" +#include "llvm/TypeFinder.h" #include "llvm/ValueSymbolTable.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallString.h" @@ -145,7 +146,7 @@ class TypePrinting { public: /// NamedTypes - The named types that are used by the current module. - std::vector<StructType*> NamedTypes; + TypeFinder NamedTypes; /// NumberedTypes - The numbered types, along with their value. DenseMap<StructType*, unsigned> NumberedTypes; @@ -164,7 +165,7 @@ public: void TypePrinting::incorporateTypes(const Module &M) { - M.findUsedStructTypes(NamedTypes); + NamedTypes.run(M, false); // The list of struct types we got back includes all the struct types, split // the unnamed ones out to a numbering and remove the anonymous structs. |