From: Ted Kremenek Date: Fri, 13 Nov 2009 01:58:01 +0000 (+0000) Subject: Pull static variable within function (for slightly faster startup time). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f0d8fff0783e92ce0e4333d0fee2fe481d16ddd7;p=clang Pull static variable within function (for slightly faster startup time). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87065 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 58642bf2a7..a0846b1abf 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -520,12 +520,14 @@ void RefVal::print(llvm::raw_ostream& Out) const { //===----------------------------------------------------------------------===// typedef llvm::ImmutableMap RefBindings; -static int RefBIndex = 0; namespace clang { template<> struct GRStateTrait : public GRStatePartialTrait { - static inline void* GDMIndex() { return &RefBIndex; } + static void* GDMIndex() { + static int RefBIndex = 0; + return &RefBIndex; + } }; }