ManagedStatic: remove many straightforward uses in llvm

(Reapply after revert in e9ce1a5880 due to
Fuchsia test failures. Removed changes in lib/ExecutionEngine/ other
than error categories, to be checked in more detail and reapplied
separately.)

Bulk remove many of the more trivial uses of ManagedStatic in the llvm
directory, either by defining a new getter function or, in many cases,
moving the static variable directly into the only function that uses it.

Differential Revision: https://reviews.llvm.org/D129120
This commit is contained in:
Nicolai Hähnle
2022-06-29 14:29:33 +02:00
parent e9ce1a5880
commit ede600377c
31 changed files with 148 additions and 143 deletions

View File

@@ -69,7 +69,6 @@
#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
@@ -7446,10 +7445,9 @@ class BitcodeErrorCategoryType : public std::error_category {
} // end anonymous namespace
static ManagedStatic<BitcodeErrorCategoryType> ErrorCategory;
const std::error_category &llvm::BitcodeErrorCategory() {
return *ErrorCategory;
static BitcodeErrorCategoryType ErrorCategory;
return ErrorCategory;
}
static Expected<StringRef> readBlobInRecord(BitstreamCursor &Stream,