aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-07-15 23:52:44 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-07-16 07:38:16 +0000
commit76374573ce829b083b95b74937a11e9b91f8f45f (patch)
treed3d4858038abe40a2eb763e04e6c93f8902691af /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
parent8d051d854619956de633047409149cdab1e3319a (diff)
downloadllvm-76374573ce829b083b95b74937a11e9b91f8f45f.zip
llvm-76374573ce829b083b95b74937a11e9b91f8f45f.tar.gz
llvm-76374573ce829b083b95b74937a11e9b91f8f45f.tar.bz2
Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer
We can build it with -Werror=global-constructors now. This helps in situation where libSupport is embedded as a shared library, potential with dlopen/dlclose scenario, and when command-line parsing or other facilities may not be involved. Avoiding the implicit construction of these cl::opt can avoid double-registration issues and other kind of behavior. Reviewed By: lattner, jpienaar Differential Revision: https://reviews.llvm.org/D105959
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 1180e02..a324ff7 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -623,7 +623,8 @@ int main(int argc, char **argv) {
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
- HideUnrelatedOptions({&DwarfDumpCategory, &SectionCategory, &ColorCategory});
+ HideUnrelatedOptions(
+ {&DwarfDumpCategory, &SectionCategory, &getColorCategory()});
cl::ParseCommandLineOptions(
argc, argv,
"pretty-print DWARF debug information in object files"