This is an archive of the discontinued LLVM Phabricator instance.

[clang-extdef-mapping] Allow clang-extdef-mapping tool to output customized filename for each index entry
Needs ReviewPublic

Authored by OikawaKirie on Jan 10 2022, 2:47 AM.

Details

Summary

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.

Diff Detail

Event Timeline

OikawaKirie created this revision.Jan 10 2022, 2:47 AM
OikawaKirie requested review of this revision.Jan 10 2022, 2:47 AM

I'm not against the idea.
However, the implementation seems to be quite complicated, compared to what it's actually doing.
Can't we spare the heap allocation somehow? It doesn't seem necessary to me.