[PATCH] D116924: [clang-extdef-mapping] Allow clang-extdef-mapping tool to output customized filename for each index entry

Ella Ma via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 10 02:47:04 PST 2022


OikawaKirie created this revision.
OikawaKirie added reviewers: martong, NoQ, steakhal.
OikawaKirie added a project: clang.
Herald added subscribers: arphaman, rnkovacs.
OikawaKirie requested review of this revision.
Herald added a subscriber: cfe-commits.

The clang-extdef-mapping tool can only output the real file name of the input source file. When analyzing with AST file based CTU analysis, the file name should be adjusted to the corresponding AST file, where `.ast` will be appended to the file name, and sometimes the path will even be changed. It is very inconvenient to adjust the file path with such a separated step, especially on Windows, where utility tools such as `sed` are not available.

This patch uses `Regex::sub` function to adjust the output file name for each index entry with the pattern provided by the user.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116924

Files:
  clang/test/Analysis/func-mapping-path.c
  clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116924.398543.patch
Type: text/x-patch
Size: 5169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220110/c598ba8b/attachment.bin>


More information about the cfe-commits mailing list