From 519fc96c475680de2cc49e7811dbbfadb912cbcc Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 23 Oct 2019 17:52:09 +0000 Subject: Vendor import of stripped clang trunk r375505, the last commit before the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/cfe/trunk@375505 --- lib/Driver/DriverOptions.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/Driver/DriverOptions.cpp') diff --git a/lib/Driver/DriverOptions.cpp b/lib/Driver/DriverOptions.cpp index 1ad188838eda..67d4198d222a 100644 --- a/lib/Driver/DriverOptions.cpp +++ b/lib/Driver/DriverOptions.cpp @@ -39,14 +39,17 @@ public: } -std::unique_ptr clang::driver::createDriverOptTable() { - auto Result = llvm::make_unique(); - // Options.inc is included in DriverOptions.cpp, and calls OptTable's - // addValues function. - // Opt is a variable used in the code fragment in Options.inc. - OptTable &Opt = *Result; +const llvm::opt::OptTable &clang::driver::getDriverOptTable() { + static const DriverOptTable *Table = []() { + auto Result = std::make_unique(); + // Options.inc is included in DriverOptions.cpp, and calls OptTable's + // addValues function. + // Opt is a variable used in the code fragment in Options.inc. + OptTable &Opt = *Result; #define OPTTABLE_ARG_INIT #include "clang/Driver/Options.inc" #undef OPTTABLE_ARG_INIT - return std::move(Result); + return Result.release(); + }(); + return *Table; } -- cgit v1.2.3