aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.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 03:33:20 +0000
commit42f588f39c5ce6f521e3709b8871d1fdd076292f (patch)
tree5ad9009fe09e82045e3a57cf39167e223ab00a27 /llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
parentb4c93ece8e4f6e98a15daca10c8a3db33cf8c195 (diff)
downloadllvm-42f588f39c5ce6f521e3709b8871d1fdd076292f.zip
llvm-42f588f39c5ce6f521e3709b8871d1fdd076292f.tar.gz
llvm-42f588f39c5ce6f521e3709b8871d1fdd076292f.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-libtool-darwin/llvm-libtool-darwin.cpp')
-rw-r--r--llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
index 9b01ff5..ef4aec5 100644
--- a/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
+++ b/llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp
@@ -571,7 +571,7 @@ static Expected<Config> parseCommandLine(int Argc, char **Argv) {
int main(int Argc, char **Argv) {
InitLLVM X(Argc, Argv);
- cl::HideUnrelatedOptions({&LibtoolCategory, &ColorCategory});
+ cl::HideUnrelatedOptions({&LibtoolCategory, &getColorCategory()});
Expected<Config> ConfigOrErr = parseCommandLine(Argc, Argv);
if (!ConfigOrErr) {
WithColor::defaultErrorHandler(ConfigOrErr.takeError());