authorgravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-10-12 15:27:57+02:00
committergravatar for thatlemon@gmail.comLemonBoy <thatlemon@gmail.com> 2019-10-12 15:27:57+02:00
log8a36064c9695a82974d7ea87728bd70db77ae6da
treebfb30194c31a80817b88742a9ab8c31c64bcda1d
parent935cce2414d11a7d0dd20416a0e8118a8474ce6e

Replace usage of createDriverOptTable


2 files changed, 7 insertions(+), 7 deletions(-)

src/zig_clang_cc1as_main.cpp+5-5
......@@ -174,11 +174,11 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
174174 bool Success = true;
175175
176176 // Parse the arguments.
177 std::unique_ptr<OptTable> OptTbl(createDriverOptTable());
177 const OptTable &OptTbl = getDriverOptTable();
178178
179179 const unsigned IncludedFlagsBitmask = options::CC1AsOption;
180180 unsigned MissingArgIndex, MissingArgCount;
181 InputArgList Args = OptTbl->ParseArgs(Argv, MissingArgIndex, MissingArgCount,
181 InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount,
182182 IncludedFlagsBitmask);
183183
184184 // Check for missing argument error.
......@@ -192,7 +192,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
192192 for (const Arg *A : Args.filtered(OPT_UNKNOWN)) {
193193 auto ArgString = A->getAsString(Args);
194194 std::string Nearest;
195 if (OptTbl->findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)
195 if (OptTbl.findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)
196196 Diags.Report(diag::err_drv_unknown_argument) << ArgString;
197197 else
198198 Diags.Report(diag::err_drv_unknown_argument_with_suggestion)
......@@ -569,8 +569,8 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
569569 return 1;
570570
571571 if (Asm.ShowHelp) {
572 std::unique_ptr<OptTable> Opts(driver::createDriverOptTable());
573 Opts->PrintHelp(llvm::outs(), "clang -cc1as [options] file...",
572 const OptTable &Opts = getDriverOptTable();
573 Opts.PrintHelp(llvm::outs(), "clang -cc1as [options] file...",
574574 "Clang Integrated Assembler",
575575 /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0,
576576 /*ShowAllAliases=*/false);
src/zig_clang_driver.cpp+2-2
......@@ -268,10 +268,10 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient,
268268static DiagnosticOptions *
269269CreateAndPopulateDiagOpts(ArrayRef<const char *> argv) {
270270 auto *DiagOpts = new DiagnosticOptions;
271 std::unique_ptr<OptTable> Opts(createDriverOptTable());
271 const OptTable &Opts = getDriverOptTable();
272272 unsigned MissingArgIndex, MissingArgCount;
273273 InputArgList Args =
274 Opts->ParseArgs(argv.slice(1), MissingArgIndex, MissingArgCount);
274 Opts.ParseArgs(argv.slice(1), MissingArgIndex, MissingArgCount);
275275 // We ignore MissingArgCount and the return value of ParseDiagnosticArgs.
276276 // Any errors that would be diagnosed here will also be diagnosed later,
277277 // when the DiagnosticsEngine actually exists.