aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ErrorTest.cpp
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2022-06-29 14:29:33 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2022-07-10 10:29:15 +0200
commitede600377cb6df1bef71f070130d8cfe734cc5b7 (patch)
tree0e9d4a1c99ad8e2516568ec42be86f1fbe0c6737 /llvm/unittests/Support/ErrorTest.cpp
parente9ce1a588030d8d4004f5d7e443afe46245e9a92 (diff)
downloadllvm-ede600377cb6df1bef71f070130d8cfe734cc5b7.zip
llvm-ede600377cb6df1bef71f070130d8cfe734cc5b7.tar.gz
llvm-ede600377cb6df1bef71f070130d8cfe734cc5b7.tar.bz2
ManagedStatic: remove many straightforward uses in llvm
(Reapply after revert in e9ce1a588030d8d4004f5d7e443afe46245e9a92 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
Diffstat (limited to 'llvm/unittests/Support/ErrorTest.cpp')
-rw-r--r--llvm/unittests/Support/ErrorTest.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/unittests/Support/ErrorTest.cpp b/llvm/unittests/Support/ErrorTest.cpp
index 547566c..57dda99 100644
--- a/llvm/unittests/Support/ErrorTest.cpp
+++ b/llvm/unittests/Support/ErrorTest.cpp
@@ -12,7 +12,6 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/ManagedStatic.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
@@ -1039,8 +1038,10 @@ public:
}
};
-static llvm::ManagedStatic<TestErrorCategory> TestErrCategory;
-const std::error_category &TErrorCategory() { return *TestErrCategory; }
+const std::error_category &TErrorCategory() {
+ static TestErrorCategory TestErrCategory;
+ return TestErrCategory;
+}
char TestDebugError::ID;