[PATCH] D73060: [Clang] Fix expansion of response files in -Wp after integrated-cc1 change

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 21 10:29:49 PST 2020


hans added inline comments.


================
Comment at: clang/tools/driver/driver.cpp:338
+  static unsigned ReenteranceCount;
+  if (ReenteranceCount++)
+    llvm::cl::ResetAllOptionOccurrences();
----------------
aganea wrote:
> hans wrote:
> > This looks pretty hacky.
> > 
> > Can you explain more what the current problem is and how you're proposing to fix it? I'm not familiar with the -Wp flag and how it relates to response files.
> The problem is that for `-Wp, at file.rsp`, file.rsp is not expanded anymore, because previously it was done in the cc1 process, at L379 below.
> 
> This patch calls back into `ExecuteClangTool` instead of `ExecuteCC1Tool`. This was my initial proposal for rGb4a99a061f517e60985667e39519f60186cbb469, purposely to fix this issue (which I forgot about)
> 
> An alternate way is to duplicate L379 into `ExecuteCC1Tool`, but I felt that wasn't pretty and opens the door to more code duplication down the line. See D73120 for an alternate implementation.
I think that if cc1 is supposed to expand response files, then let's make that explicit.

I don't think the "reenter" flag in D73120 is necessary: if cc1 is supposed to expand response files, let's make it do that always.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73060/new/

https://reviews.llvm.org/D73060





More information about the cfe-commits mailing list