This is an archive of the discontinued LLVM Phabricator instance.

[include-fixer] Be smarter about inserting symbols for a prefix.
ClosedPublic

Authored by bkramer on Jun 3 2016, 6:43 AM.

Details

Summary

If prefix search finds something where nothing can be nested under (e.g.
a variable or macro) don't add it to the result.

This is for cases like:
header.h:

extern int a;

file.cc:
namespace a {

SOME_MACRO

}

We will look up a::SOME_MACRO, which doesn't have any results. Then we
look up 'a' and find something before we ever look up just 'SOME_MACRO'.
With some basic filtering we can avoid this case.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer updated this revision to Diff 59545.Jun 3 2016, 6:43 AM
bkramer retitled this revision from to [include-fixer] Be smarter about inserting symbols for a prefix..
bkramer updated this object.
bkramer added reviewers: hokein, ioeric.
bkramer added a subscriber: cfe-commits.
ioeric accepted this revision.Jun 3 2016, 7:12 AM
ioeric edited edge metadata.

LG.

This revision is now accepted and ready to land.Jun 3 2016, 7:12 AM
This revision was automatically updated to reflect the committed changes.