Fix -Wnonportable-include-path suppression for header maps with absolute paths.In `DirectoryLookup::LookupFile` parameter `HasBeenMapped` doesn't coverthe case when clang finds a file through a he
Fix -Wnonportable-include-path suppression for header maps with absolute paths.In `DirectoryLookup::LookupFile` parameter `HasBeenMapped` doesn't coverthe case when clang finds a file through a header map but doesn't remapthe lookup filename because the target path is an absolute path. As aresult, -Wnonportable-include-path suppression for header mapsintroduced in r301592 wasn't triggered.Change parameter `HasBeenMapped` to `IsInHeaderMap` and use parameter`MappedName` to track the filename remapping. This way we can handleboth relative and absolute paths in header maps, and account for theirspecific properties, like filename remapping being a property preservedacross lookups in multiple directories.rdar://problem/39516483Reviewers: dexonsmith, brunoReviewed By: dexonsmithSubscribers: jkorous, cfe-commits, ributzkaDifferential Revision: https://reviews.llvm.org/D58094llvm-svn: 371655
show more ...
Re-apply: Add python tool to dump and construct header mapsHeader maps are binary files used by Xcode, which are used to mapheader names or paths to other locations. Clang has support forthose si
Re-apply: Add python tool to dump and construct header mapsHeader maps are binary files used by Xcode, which are used to mapheader names or paths to other locations. Clang has support forthose since its inception, but there's not a lot of header maptesting around.Since it's a binary format, testing becomes pretty much brittleand its hard to even know what's inside if you don't have theappropriate tools.Add a python based tool that allows creating and dumping headermaps based on a json description of those. While here, rewritetests to use the tool and remove the binary files from the tree.This tool was initially written by Daniel Dunbar.Thanks to Stella Stamenova for helping make this work on Windows.Differential Revision: https://reviews.llvm.org/D46485rdar://problem/39994722llvm-svn: 335295
Revert "Add python tool to dump and construct header maps"This reverts commit fcfa2dd517ec1a6045a81e8247e346d630a22618.Broke bots:http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/1
Revert "Add python tool to dump and construct header maps"This reverts commit fcfa2dd517ec1a6045a81e8247e346d630a22618.Broke bots:http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11315http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/10411/steps/test-check-all/logs/stdiollvm-svn: 335196
Add python tool to dump and construct header mapsHeader maps are binary files used by Xcode, which are used to mapheader names or paths to other locations. Clang has support forthose since its in
Add python tool to dump and construct header mapsHeader maps are binary files used by Xcode, which are used to mapheader names or paths to other locations. Clang has support forthose since its inception, but there's not a lot of header maptesting around.Since it's a binary format, testing becomes pretty much brittleand its hard to even know what's inside if you don't have theappropriate tools.Add a python based tool that allows creating and dumping headermaps based on a json description of those. While here, rewritetests to use the tool and remove the binary files from the tree.This tool was initially written by Daniel Dunbar.Differential Revision: https://reviews.llvm.org/D46485rdar://problem/39994722llvm-svn: 335177
Preprocessor: Suppress -Wnonportable-include-path for header mapsIf a file search involves a header map, suppress-Wnonportable-include-path. It's firing lots of false positives forframework auth
Preprocessor: Suppress -Wnonportable-include-path for header mapsIf a file search involves a header map, suppress-Wnonportable-include-path. It's firing lots of false positives forframework authors internally, and it's not trivial to fix.Consider a framework called "Foo" with a main (installed) framework header"Foo/Foo.h". It's atypical for "Foo.h" to actually live inside adirectory called "Foo" in the source repository. Instead, thebuild system generates a header map while building the framework.If Foo.h lives at the top-level of the source repository (common), andthe git repo is called ssh://some.url/foo.git, then the header map willhave something like: Foo/Foo.h -> /Users/myname/code/foo/Foo.hwhere "/Users/myname/code/foo" is the clone of ssh://some.url/foo.git.After #import <Foo/Foo.h>, the current implementation of-Wnonportable-include-path will falsely assume that Foo.h was found in anonportable way, because of the name of the git clone (.../foo/Foo.h).However, that directory name was not involved in the header search atall.This commit adds an extra parameter to Preprocessor::LookupFile andHeaderSearch::LookupFile to track if the search used a header map,making it easy to suppress the warning. Longer term, once we find a wayto avoid the false positive, we should turn the warning back on.rdar://problem/28863903llvm-svn: 301592