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 09:15:08 +0200
commite6f1f062457c928c18a88c612f39d9e168f65a85 (patch)
treeb90f5190cbeabf748e143602c280c37567d78850 /llvm/unittests/Support/ErrorTest.cpp
parentda6a14b91ad999327b41a9040577273591e4ad1d (diff)
downloadllvm-e6f1f062457c928c18a88c612f39d9e168f65a85.zip
llvm-e6f1f062457c928c18a88c612f39d9e168f65a85.tar.gz
llvm-e6f1f062457c928c18a88c612f39d9e168f65a85.tar.bz2
ManagedStatic: remove many straightforward uses in llvm
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;