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,...@@ -174,11 +174,11 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
174 bool Success = true;174 bool Success = true;
175175
176 // Parse the arguments.176 // Parse the arguments.
177 std::unique_ptr<OptTable> OptTbl(createDriverOptTable());177 const OptTable &OptTbl = getDriverOptTable();
178178
179 const unsigned IncludedFlagsBitmask = options::CC1AsOption;179 const unsigned IncludedFlagsBitmask = options::CC1AsOption;
180 unsigned MissingArgIndex, MissingArgCount;180 unsigned MissingArgIndex, MissingArgCount;
181 InputArgList Args = OptTbl->ParseArgs(Argv, MissingArgIndex, MissingArgCount,181 InputArgList Args = OptTbl.ParseArgs(Argv, MissingArgIndex, MissingArgCount,
182 IncludedFlagsBitmask);182 IncludedFlagsBitmask);
183183
184 // Check for missing argument error.184 // Check for missing argument error.
...@@ -192,7 +192,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,...@@ -192,7 +192,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
192 for (const Arg *A : Args.filtered(OPT_UNKNOWN)) {192 for (const Arg *A : Args.filtered(OPT_UNKNOWN)) {
193 auto ArgString = A->getAsString(Args);193 auto ArgString = A->getAsString(Args);
194 std::string Nearest;194 std::string Nearest;
195 if (OptTbl->findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)195 if (OptTbl.findNearest(ArgString, Nearest, IncludedFlagsBitmask) > 1)
196 Diags.Report(diag::err_drv_unknown_argument) << ArgString;196 Diags.Report(diag::err_drv_unknown_argument) << ArgString;
197 else197 else
198 Diags.Report(diag::err_drv_unknown_argument_with_suggestion)198 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) {...@@ -569,8 +569,8 @@ int cc1as_main(ArrayRef<const char *> Argv, const char *Argv0, void *MainAddr) {
569 return 1;569 return 1;
570570
571 if (Asm.ShowHelp) {571 if (Asm.ShowHelp) {
572 std::unique_ptr<OptTable> Opts(driver::createDriverOptTable());572 const OptTable &Opts = getDriverOptTable();
573 Opts->PrintHelp(llvm::outs(), "clang -cc1as [options] file...",573 Opts.PrintHelp(llvm::outs(), "clang -cc1as [options] file...",
574 "Clang Integrated Assembler",574 "Clang Integrated Assembler",
575 /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0,575 /*Include=*/driver::options::CC1AsOption, /*Exclude=*/0,
576 /*ShowAllAliases=*/false);576 /*ShowAllAliases=*/false);
src/zig_clang_driver.cpp+2-2
...@@ -268,10 +268,10 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient,...@@ -268,10 +268,10 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient,
268static DiagnosticOptions *268static DiagnosticOptions *
269CreateAndPopulateDiagOpts(ArrayRef<const char *> argv) {269CreateAndPopulateDiagOpts(ArrayRef<const char *> argv) {
270 auto *DiagOpts = new DiagnosticOptions;270 auto *DiagOpts = new DiagnosticOptions;
271 std::unique_ptr<OptTable> Opts(createDriverOptTable());271 const OptTable &Opts = getDriverOptTable();
272 unsigned MissingArgIndex, MissingArgCount;272 unsigned MissingArgIndex, MissingArgCount;
273 InputArgList Args =273 InputArgList Args =
274 Opts->ParseArgs(argv.slice(1), MissingArgIndex, MissingArgCount);274 Opts.ParseArgs(argv.slice(1), MissingArgIndex, MissingArgCount);
275 // We ignore MissingArgCount and the return value of ParseDiagnosticArgs.275 // We ignore MissingArgCount and the return value of ParseDiagnosticArgs.
276 // Any errors that would be diagnosed here will also be diagnosed later,276 // Any errors that would be diagnosed here will also be diagnosed later,
277 // when the DiagnosticsEngine actually exists.277 // when the DiagnosticsEngine actually exists.