Skip to content

Commit

Permalink
Revert "[CommandLine] Avoid ManagedStatic.h include (NFC)"
Browse files Browse the repository at this point in the history
This reverts commit 82c97bd.

Reason for revert: <missing kfdtest fix>

Change-Id: Ia03779380b149b7bbf011b6ad61354afb907cb25
  • Loading branch information
ronlieb committed Jun 26, 2024
1 parent 2b0ed20 commit c1d7aa7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion clang/lib/Frontend/PrecompiledPreamble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/VirtualFileSystem.h"
Expand Down
1 change: 0 additions & 1 deletion lldb/utils/TableGen/LLDBTableGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#include "LLDBTableGenBackends.h" // Declares all backends.
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
#include "llvm/TableGen/Error.h"
Expand Down
7 changes: 7 additions & 0 deletions llvm/include/llvm/Support/CommandLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/StringSaver.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
Expand Down Expand Up @@ -236,6 +237,12 @@ class SubCommand {
Option *ConsumeAfterOpt = nullptr; // The ConsumeAfter option if it exists.
};

// A special subcommand representing no subcommand
extern ManagedStatic<SubCommand> TopLevelSubCommand;

// A special subcommand that can be used to put an option into all subcommands.
extern ManagedStatic<SubCommand> AllSubCommands;

class SubCommandGroup {
SmallVector<SubCommand *, 4> Subs;

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Support/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ void OptionCategory::registerCategory() {
// initialization because it is referenced from cl::opt constructors, which run
// dynamically in an arbitrary order.
LLVM_REQUIRE_CONSTANT_INITIALIZATION
static ManagedStatic<SubCommand> TopLevelSubCommand;
ManagedStatic<SubCommand> llvm::cl::TopLevelSubCommand;

// A special subcommand that can be used to put an option into all subcommands.
static ManagedStatic<SubCommand> AllSubCommands;
ManagedStatic<SubCommand> llvm::cl::AllSubCommands;

SubCommand &SubCommand::getTopLevel() { return *TopLevelSubCommand; }

Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Support/RandomNumberGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
#ifdef _WIN32
#include "llvm/Support/Windows/WindowsSupport.h"
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Support/TypeSize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "llvm/Support/TypeSize.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/WithColor.h"

#include "DebugOptions.h"
Expand Down
4 changes: 4 additions & 0 deletions revert_patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,8 @@ contact: Ron and Jay
Reverts: break componsableKernels
9a88aa0e2b6d [Clang][Sema] Diagnose variable template explicit specializati
contact: RonL

---
Reverts: breaks build of kfdtest
Revert "[CommandLine] Avoid ManagedStatic.h include (NFC)"
---

0 comments on commit c1d7aa7

Please sign in to comment.