From 5f65adda508bff0e9f40cf6013469c76fdcb1a09 Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Thu, 4 Mar 2004 17:50:44 +0000 Subject: [PATCH] Hide variable from other functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12118 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/CommandLine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Support/CommandLine.cpp b/lib/Support/CommandLine.cpp index 8a6bd77e401..2c699d94888 100644 --- a/lib/Support/CommandLine.cpp +++ b/lib/Support/CommandLine.cpp @@ -48,8 +48,9 @@ static Option *getOption(const std::string &Str) { } static std::vector &getPositionalOpts() { - static std::vector Positional; - return Positional; + static std::vector *Positional = 0; + if (!Positional) Positional = new std::vector(); + return *Positional; } static void AddArgument(const char *ArgName, Option *Opt) { -- 2.34.1