This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Alternate fix for "expansion of response files in -Wp after integrated-cc1 change"
ClosedPublic

Authored by aganea on Jan 21 2020, 9:38 AM.

Details

Summary

After rGb4a99a061f517e60985667e39519f60186cbb469, passing a response file such as -Wp,@a.rsp wasn't working anymore because .rsp expansion happens inside clang's main() function.

This patch adds response file expansion in ExecuteCC1Tool().

Just noticing along the way that explicit flags provided to`-Wp` are parsed in the driver, whereas flags provided in the response file are parsed in the -cc1 tool. Which means one can't use the same flags inside the response file, as opposed to being provided directly, ie. -Wp,-MT,FOO.d. Saying -Wp,a.rsp, where a.rsp contains -MT,Foo.d would not work.

Diff Detail

Event Timeline

aganea created this revision.Jan 21 2020, 9:38 AM
aganea edited the summary of this revision. (Show Details)Jan 21 2020, 1:19 PM
aganea added reviewers: hans, wenlei.
aganea set the repository for this revision to rG LLVM Github Monorepo.
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2020, 1:19 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aganea updated this revision to Diff 239420.Jan 21 2020, 1:20 PM

Remove Reenter flag as requested by @hans here.

hans accepted this revision.Jan 22 2020, 11:22 AM

Looks reasonable to me.

clang/test/Driver/Wp-args.c
27

Why inception? I feel like I'm missing something :)

This revision is now accepted and ready to land.Jan 22 2020, 11:22 AM
aganea marked 2 inline comments as done.Jan 22 2020, 11:31 AM
aganea added inline comments.
clang/test/Driver/Wp-args.c
27

Could be anything else :) Because -rewrite-macros prints this .c with comments, and then FileCheck looks for that tag in stdout.

hans added inline comments.Jan 22 2020, 11:44 AM
clang/test/Driver/Wp-args.c
27

Ah, I see.

Do you think it would be possible to do something simpler, like just pass a -D flag and check that it gets set? That would be easier for future readers of the test to understand.

aganea marked 3 inline comments as done.Jan 22 2020, 1:54 PM
aganea added inline comments.
clang/test/Driver/Wp-args.c
27

Done in the commit.

This revision was automatically updated to reflect the committed changes.
aganea marked an inline comment as done.