[PATCH] D130578: ManagedStatic: remove a use from Clang

Nicolai Hähnle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 26 07:55:37 PDT 2022


nhaehnle created this revision.
nhaehnle added reviewers: efriedma, lattner.
Herald added a project: All.
nhaehnle requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130578

Files:
  clang/lib/Frontend/PrecompiledPreamble.cpp


Index: clang/lib/Frontend/PrecompiledPreamble.cpp
===================================================================
--- clang/lib/Frontend/PrecompiledPreamble.cpp
+++ clang/lib/Frontend/PrecompiledPreamble.cpp
@@ -817,10 +817,9 @@
 }
 CommentHandler *PreambleCallbacks::getCommentHandler() { return nullptr; }
 
-static llvm::ManagedStatic<BuildPreambleErrorCategory> BuildPreambleErrCategory;
-
 std::error_code clang::make_error_code(BuildPreambleError Error) {
-  return std::error_code(static_cast<int>(Error), *BuildPreambleErrCategory);
+  static BuildPreambleErrorCategory BuildPreambleErrCategory;
+  return std::error_code(static_cast<int>(Error), BuildPreambleErrCategory);
 }
 
 const char *BuildPreambleErrorCategory::name() const noexcept {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130578.447706.patch
Type: text/x-patch
Size: 756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220726/cde75406/attachment.bin>


More information about the cfe-commits mailing list