[llvm-branch-commits] [cfe-branch] r292311 - Merging r292032:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 17 16:16:39 PST 2017


Author: hans
Date: Tue Jan 17 18:16:39 2017
New Revision: 292311

URL: http://llvm.org/viewvc/llvm-project?rev=292311&view=rev
Log:
Merging r292032:
------------------------------------------------------------------------
r292032 | yrnkrn | 2017-01-14 13:12:08 -0800 (Sat, 14 Jan 2017) | 4 lines

Fix PR31644 introduced by r287138 and add a regression test.
Thanks Dimitry Andric for the report and fix!


------------------------------------------------------------------------

Modified:
    cfe/branches/release_40/   (props changed)
    cfe/branches/release_40/lib/Frontend/DependencyFile.cpp
    cfe/branches/release_40/test/Preprocessor/dependencies-and-pp.c

Propchange: cfe/branches/release_40/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 17 18:16:39 2017
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291964,292265
+/cfe/trunk:291850,291853,291865,291871,291877,291879,291881,291907,291964,292032,292265
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_40/lib/Frontend/DependencyFile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/lib/Frontend/DependencyFile.cpp?rev=292311&r1=292310&r2=292311&view=diff
==============================================================================
--- cfe/branches/release_40/lib/Frontend/DependencyFile.cpp (original)
+++ cfe/branches/release_40/lib/Frontend/DependencyFile.cpp Tue Jan 17 18:16:39 2017
@@ -447,9 +447,9 @@ void DFGImpl::OutputDependencyFile() {
   // Create phony targets if requested.
   if (PhonyTarget && !Files.empty()) {
     // Skip the first entry, this is always the input file itself.
-    for (StringRef File : Files) {
+    for (auto I = Files.begin() + 1, E = Files.end(); I != E; ++I) {
       OS << '\n';
-      PrintFilename(OS, File, OutputFormat);
+      PrintFilename(OS, *I, OutputFormat);
       OS << ":\n";
     }
   }

Modified: cfe/branches/release_40/test/Preprocessor/dependencies-and-pp.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_40/test/Preprocessor/dependencies-and-pp.c?rev=292311&r1=292310&r2=292311&view=diff
==============================================================================
--- cfe/branches/release_40/test/Preprocessor/dependencies-and-pp.c (original)
+++ cfe/branches/release_40/test/Preprocessor/dependencies-and-pp.c Tue Jan 17 18:16:39 2017
@@ -32,5 +32,12 @@
 // RUN: FileCheck -check-prefix=TEST5 %s < %t.d
 // TEST5: foo $$(bar) b az qu\ ux \ space:
 
+// Test self dependency, PR31644
+
+// RUN: %clang -E -MD -MP -MF %t.d %s
+// RUN: FileCheck -check-prefix=TEST6 %s < %t.d
+// TEST6: dependencies-and-pp.c
+// TEST6-NOT: dependencies-and-pp.c:
+
 // TODO: Test default target without quoting
 // TODO: Test default target with quoting




More information about the llvm-branch-commits mailing list