Page MenuHomePhabricator

New clang option -MD-filter=prefix to filter files from make dependencies
AbandonedPublic

Authored by mibintc on May 9 2019, 10:02 AM.

Details

Reviewers
fedor.sergeev
dexonsmith
rjmccall
probinson
eli.friedman
dstenb
vsapsai
Group Reviewers
Restricted Project
Summary

Intel is developing an offload compiler based on clang (that will eventually be contributed to open source). In the course of the compilation many temporary .h files are generated in /tmp. We'd like to have a way of eliding these dependencies from the -MD output. This new option -MD-filter=prefixstring is proposed.

Diff Detail

Event Timeline

mibintc created this revision.May 9 2019, 10:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2019, 10:02 AM
mibintc marked an inline comment as done.May 9 2019, 1:57 PM

added an inline comment about the use of strncmp

lib/Frontend/DependencyFile.cpp
279

I wasn't sure about using strncmp to do the prefix comparison, but i checked around in the clang code and saw strncmp used in several places so I thought it would be acceptable.

xbolva00 added inline comments.
lib/Frontend/DependencyFile.cpp
279

DependencyFilter.compare(Filename)?

xbolva00 added inline comments.May 10 2019, 12:26 AM
lib/Frontend/DependencyFile.cpp
279

They are overloads with pos and len.

mibintc updated this revision to Diff 199082.May 10 2019, 2:15 PM

respond to suggestion from @xbolva00 (thanks). Added a test case where prefix fails to match

@dexonsmith Can you take a look at this patch or recommend someone who can review it? Many thanks. --Melanie

@rjmccall Can you take a look at this patch or recommend someone who can review it? Many thanks. --Melanie

mibintc abandoned this revision.May 30 2019, 5:52 AM

I'll modify this to be a cc1 only option, there doesn't seem to be community interest.