diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-08 05:33:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-08 05:33:04 +0000 |
commit | fc65d38085e92fa3901104c762a725788f5c9de5 (patch) | |
tree | f0fcde151478824cee933c6cd67b8947c509a73e /include/llvm/PassAnalysisSupport.h | |
parent | f131fa26e6eca719e793e2fc7fe750040e9357a6 (diff) | |
download | llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.gz llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.bz2 llvm-fc65d38085e92fa3901104c762a725788f5c9de5.tar.xz |
Speed up the passmgr by avoiding heap thrashing on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/PassAnalysisSupport.h')
-rw-r--r-- | include/llvm/PassAnalysisSupport.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/llvm/PassAnalysisSupport.h b/include/llvm/PassAnalysisSupport.h index 4d19858bc9..c6ed179af6 100644 --- a/include/llvm/PassAnalysisSupport.h +++ b/include/llvm/PassAnalysisSupport.h @@ -20,6 +20,7 @@ #define LLVM_PASS_ANALYSIS_SUPPORT_H #include <vector> +#include "llvm/ADT/SmallVector.h" namespace llvm { @@ -34,9 +35,14 @@ namespace llvm { // Pass infrastructure through the getAnalysisUsage virtual function. // class AnalysisUsage { +public: + typedef SmallVector<AnalysisID, 32> VectorType; + +private: // Sets of analyses required and preserved by a pass - std::vector<AnalysisID> Required, RequiredTransitive, Preserved; + VectorType Required, RequiredTransitive, Preserved; bool PreservesAll; + public: AnalysisUsage() : PreservesAll(false) {} @@ -95,11 +101,11 @@ public: /// void setPreservesCFG(); - const std::vector<AnalysisID> &getRequiredSet() const { return Required; } - const std::vector<AnalysisID> &getRequiredTransitiveSet() const { + const VectorType &getRequiredSet() const { return Required; } + const VectorType &getRequiredTransitiveSet() const { return RequiredTransitive; } - const std::vector<AnalysisID> &getPreservedSet() const { return Preserved; } + const VectorType &getPreservedSet() const { return Preserved; } }; //===----------------------------------------------------------------------===// |