diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-04 05:05:18 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-04 05:05:18 +0000 |
commit | cfb320f5f97717c309832e0f92b97835526977a8 (patch) | |
tree | 8a89e3e8c55dcdb9d712937ea79da2936fcaf7a5 /include | |
parent | 2e013028f2dd99527044d50808a44ae89d6ba537 (diff) |
Fix a performance bug in the Linker.
Now that we hava a convinient place to keep it, remeber the set of
identified structs as we merge modules.
This speeds up the linking of all the bitcode files in clang with the
gold plugin and -plugin-opt=emit-llvm (i.e., link only, no codegen) from
5:25 minutes to 13.6 seconds!
Patch by Xiaofei Wan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Linker.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/llvm/Linker.h b/include/llvm/Linker.h index deaaca4155..3667b8521d 100644 --- a/include/llvm/Linker.h +++ b/include/llvm/Linker.h @@ -10,12 +10,14 @@ #ifndef LLVM_LINKER_H #define LLVM_LINKER_H +#include "llvm/ADT/SmallPtrSet.h" #include <string> namespace llvm { class Module; class StringRef; +class StructType; /// This class provides the core functionality of linking in LLVM. It keeps a /// pointer to the merged module so far. It doesn't take ownership of the @@ -47,6 +49,7 @@ class Linker { private: Module *Composite; + SmallPtrSet<StructType*, 32> IdentifiedStructTypes; }; } // End llvm namespace |