Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-apply: Add python tool to dump and construct header maps
Header maps are binary files used by Xcode, which are used to map header names or paths to other locations. Clang has support for those since its inception, but there's not a lot of header map testing around. Since it's a binary format, testing becomes pretty much brittle and its hard to even know what's inside if you don't have the appropriate tools. Add a python based tool that allows creating and dumping header maps based on a json description of those. While here, rewrite tests 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/D46485 rdar://problem/39994722 llvm-svn: 335295
- Loading branch information
1 parent
30648ab
commit dc3f88a
Showing
15 changed files
with
345 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"mappings" : | ||
{ | ||
"Foo.h" : "Foo/Foo.h" | ||
} | ||
} |
Binary file removed
BIN
-108 Bytes
clang/test/Preprocessor/Inputs/headermap-rel2/project-headers.hmap
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
clang/test/Preprocessor/Inputs/headermap-rel2/project-headers.hmap.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"mappings" : | ||
{ | ||
"someheader.h" : "Product/someheader.h" | ||
} | ||
} |
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
clang/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"mappings" : | ||
{ | ||
"Foo/Foo.h" : "headers/foo/Foo.h" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
set(CLANG_HMAPTOOL hmaptool) | ||
|
||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL} | ||
COMMAND ${CMAKE_COMMAND} -E make_directory | ||
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin | ||
COMMAND ${CMAKE_COMMAND} -E copy | ||
${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL} | ||
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/ | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${CLANG_HMAPTOOL}) | ||
|
||
list(APPEND Depends ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/${CLANG_HMAPTOOL}) | ||
install(PROGRAMS ${CLANG_HMAPTOOL} DESTINATION bin) | ||
|
||
add_custom_target(hmaptool ALL DEPENDS ${Depends}) | ||
set_target_properties(hmaptool PROPERTIES FOLDER "Utils") | ||
|
Oops, something went wrong.