r330184 - Add some infuriatingly necessary comments to this test case.

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 17 04:08:06 PDT 2018


Author: chandlerc
Date: Tue Apr 17 04:08:05 2018
New Revision: 330184

URL: http://llvm.org/viewvc/llvm-project?rev=330184&view=rev
Log:
Add some infuriatingly necessary comments to this test case.

Without these comments, by "luck" the contents of SomeKit's SKWidget.h
are precisely the same as SomeKitCore's SomeKitCore.h. This can create
havoc if anything canonicalizes on the inode and your filesystem assigns
a common inode to files with identical file content. Alternatively, if
your build system uses symlinks into a content-addressed-storage (as
Google's does), you end up with these files being symlinks to the same
file.

The end result is that Clang deduplicates them internally, and then
believes that the SomeKit framework includes the SomeKitCore.h header,
and does not include the SKWidget.h in SomeKit. This in turn results in
warnings in this test and eventually errors as Clang becomes confused
because the umbrella header for SomeKitCore has already been included
into another framework's module (SomeKit). Yay.

If anyone has a better idea about how to avoid this, I'm all ears.
Nothing other than causing the file content to change worked for me.

Modified:
    cfe/trunk/test/Modules/Inputs/exportas-link/OtherKit.framework/Headers/OtherKit.h
    cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SKWidget.h
    cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SomeKit.h
    cfe/trunk/test/Modules/Inputs/exportas-link/SomeKitCore.framework/Headers/SomeKitCore.h

Modified: cfe/trunk/test/Modules/Inputs/exportas-link/OtherKit.framework/Headers/OtherKit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/exportas-link/OtherKit.framework/Headers/OtherKit.h?rev=330184&r1=330183&r2=330184&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/exportas-link/OtherKit.framework/Headers/OtherKit.h (original)
+++ cfe/trunk/test/Modules/Inputs/exportas-link/OtherKit.framework/Headers/OtherKit.h Tue Apr 17 04:08:05 2018
@@ -1,3 +1,4 @@
+// Umbrella header for OtherKit.
 #import <SomeKitCore/SomeKitCore.h>
 
 #ifdef F

Modified: cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SKWidget.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SKWidget.h?rev=330184&r1=330183&r2=330184&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SKWidget.h (original)
+++ cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SKWidget.h Tue Apr 17 04:08:05 2018
@@ -1 +1,2 @@
+// Delegate to SomeKitCore.
 #import <SomeKitCore/SKWidget.h>

Modified: cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SomeKit.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SomeKit.h?rev=330184&r1=330183&r2=330184&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SomeKit.h (original)
+++ cfe/trunk/test/Modules/Inputs/exportas-link/SomeKit.framework/Headers/SomeKit.h Tue Apr 17 04:08:05 2018
@@ -1 +1,6 @@
+// Umbrella header for SomeKit.
+//
+// Note that this file's content must not end up to coincidentally be identical
+// to any other file in the test which can easily happen given the reduced
+// test.
 #import <SomeKit/SKWidget.h>

Modified: cfe/trunk/test/Modules/Inputs/exportas-link/SomeKitCore.framework/Headers/SomeKitCore.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/exportas-link/SomeKitCore.framework/Headers/SomeKitCore.h?rev=330184&r1=330183&r2=330184&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/exportas-link/SomeKitCore.framework/Headers/SomeKitCore.h (original)
+++ cfe/trunk/test/Modules/Inputs/exportas-link/SomeKitCore.framework/Headers/SomeKitCore.h Tue Apr 17 04:08:05 2018
@@ -1 +1,6 @@
+// Umbrella header for SomeKitCore.
+//
+// Note that this file's content must not end up to coincidentally be identical
+// to any other file in the test which can easily happen given the reduced
+// test.
 #import <SomeKitCore/SKWidget.h>




More information about the cfe-commits mailing list