[clang] 7132bcd - ManagedStatic: remove from ASTMatchersInternal.h

Nicolai Hähnle via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 27 05:57:50 PDT 2022


Author: Nicolai Hähnle
Date: 2022-07-27T14:57:34+02:00
New Revision: 7132bcdc428d79258901af0156ace240952b6745

URL: https://github.com/llvm/llvm-project/commit/7132bcdc428d79258901af0156ace240952b6745
DIFF: https://github.com/llvm/llvm-project/commit/7132bcdc428d79258901af0156ace240952b6745.diff

LOG: ManagedStatic: remove from ASTMatchersInternal.h

Differential Revision: https://reviews.llvm.org/D130576

Added: 
    

Modified: 
    clang/include/clang/ASTMatchers/ASTMatchersInternal.h
    clang/lib/ASTMatchers/ASTMatchersInternal.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
index 49de9a458c3db..6ee82321723e4 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchersInternal.h
@@ -59,7 +59,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/iterator.h"
 #include "llvm/Support/Casting.h"
-#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Regex.h"
 #include <algorithm>
 #include <cassert>
@@ -1931,8 +1930,8 @@ template <typename Matcher, Matcher (*Func)()> class MemoizedMatcher {
 
 public:
   static const Matcher &getInstance() {
-    static llvm::ManagedStatic<Wrapper> Instance;
-    return Instance->M;
+    static Wrapper Instance;
+    return Instance.M;
   }
 };
 

diff  --git a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
index 4c438f9e4879f..f3c9f6d468f5c 100644
--- a/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
+++ b/clang/lib/ASTMatchers/ASTMatchersInternal.cpp
@@ -28,7 +28,6 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/WithColor.h"
 #include "llvm/Support/raw_ostream.h"


        


More information about the cfe-commits mailing list