[PATCH] D80454: [Clang] fix limiting -fintegrated-cc1 to only one TU

Yuanfang Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 22 12:52:42 PDT 2020


ychen created this revision.
ychen added a reviewer: aganea.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
ychen planned changes to this revision.
ychen added a comment.

This may not be complete.


For D74490 <https://reviews.llvm.org/D74490>. For cases like where external assembler is used, counting the
job number is not exactly right.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80454

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -3763,7 +3763,8 @@
   }
 
   // If we have more than one job, then disable integrated-cc1 for now.
-  if (C.getJobs().size() > 1)
+  if (std::count_if(C.getActions().begin(), C.getActions().end(),
+                    [](Action *A) { return isa<CompileJobAction>(A); }) > 1)
     for (auto &J : C.getJobs())
       J.InProcess = false;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80454.265785.patch
Type: text/x-patch
Size: 508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200522/32492c91/attachment-0001.bin>


More information about the cfe-commits mailing list