Skip to content

The real option name and not the alias used is displayed in msgs when using a config file #107613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,17 @@ static void appendOneArg(InputArgList &Args, const Arg *Opt,
Copy->setOwnsValues(Opt->getOwnsValues());
Opt->setOwnsValues(false);
Args.append(Copy);
if (Opt->getAlias()) {
const Arg *Alias = Opt->getAlias();
unsigned Index = Args.MakeIndex(Alias->getSpelling());
auto AliasCopy = std::make_unique<Arg>(Alias->getOption(),
Args.getArgString(Index), Index);
AliasCopy->getValues() = Alias->getValues();
AliasCopy->setOwnsValues(false);
if (Alias->isClaimed())
AliasCopy->claim();
Copy->setAlias(std::move(AliasCopy));
}
}

bool Driver::readConfigFile(StringRef FileName,
Expand Down
3 changes: 3 additions & 0 deletions clang/test/Driver/arm-execute-only.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

// RUN: not %clang -### --target=arm-arm-none-eabi -march=armv8-m.main -mpure-code -mno-movt %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CHECK-PURE-CODE-NO-MOVT
// RUN: echo "-DABC" > %t.cfg
// RUN: not %clang -### --target=arm-arm-none-eabi -march=armv8-m.main -mpure-code -mno-movt --config %t.cfg %s 2>&1 \
// RUN: | FileCheck %s -check-prefix CHECK-PURE-CODE-NO-MOVT
// CHECK-PURE-CODE-NO-MOVT: error: option '-mpure-code' cannot be specified with '-mno-movt'

// RUN: not %clang -### --target=arm-arm-none-eabi -march=armv6-m -mexecute-only -fropi %s 2>&1 \
Expand Down
Loading