Revert "ManagedStatic: remove from ASTMatchersInternal.h"

This reverts commit 7132bcdc428d79258901af0156ace240952b6745.

It is the likely cause of a clang-tools-extra test regression. Reverting
until I can investigate what's going on.
This commit is contained in:
Nicolai Hähnle 2022-07-27 15:46:21 +02:00
parent 3e0b557002
commit cd62604d19
2 changed files with 4 additions and 2 deletions

View File

@ -59,6 +59,7 @@
#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>
@ -1930,8 +1931,8 @@ template <typename Matcher, Matcher (*Func)()> class MemoizedMatcher {
public:
static const Matcher &getInstance() {
static Wrapper Instance;
return Instance.M;
static llvm::ManagedStatic<Wrapper> Instance;
return Instance->M;
}
};

View File

@ -28,6 +28,7 @@
#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"