From fc65d38085e92fa3901104c762a725788f5c9de5 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 8 Aug 2008 05:33:04 +0000 Subject: 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 --- include/llvm/PassAnalysisSupport.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'include/llvm/PassAnalysisSupport.h') 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 +#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 VectorType; + +private: // Sets of analyses required and preserved by a pass - std::vector Required, RequiredTransitive, Preserved; + VectorType Required, RequiredTransitive, Preserved; bool PreservesAll; + public: AnalysisUsage() : PreservesAll(false) {} @@ -95,11 +101,11 @@ public: /// void setPreservesCFG(); - const std::vector &getRequiredSet() const { return Required; } - const std::vector &getRequiredTransitiveSet() const { + const VectorType &getRequiredSet() const { return Required; } + const VectorType &getRequiredTransitiveSet() const { return RequiredTransitive; } - const std::vector &getPreservedSet() const { return Preserved; } + const VectorType &getPreservedSet() const { return Preserved; } }; //===----------------------------------------------------------------------===// -- cgit v1.2.3