This is an archive of the discontinued LLVM Phabricator instance.

[clang][Index] Fix usage of IndexImplicitInstantiation
ClosedPublic

Authored by kadircet on Feb 13 2019, 9:14 AM.

Details

Summary

Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.

Diff Detail

Event Timeline

kadircet created this revision.Feb 13 2019, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 13 2019, 9:14 AM

Only have a few NITs, will dig deeper into the change tomorrow.
Added @arphaman too as an owner of the index library. Alex, feel free to reassign if you're the wrong person to take a look at this

unittests/Index/IndexTests.cpp
57

NIT: initialize with 0 to avoid UB.

66

Why do we need to static_cast to int? Can we leave out the cast?

71

NIT: maybe make it a free-standing function, accepting two parameters:

struct Position {
  friend bool operator==(const Pos& L, const Pos& R) {
    // ...
  }
};

Doesn't really matter much here, though, just a general best practice.

98

NIT: initialize with null to make UB less likely

ilya-biryukov added inline comments.Feb 13 2019, 10:36 AM
unittests/Index/IndexTests.cpp
56

NIT: put all of the decls of a file into an anonymous namespace

This revision is now accepted and ready to land.Feb 15 2019, 4:37 AM
kadircet updated this revision to Diff 186995.Feb 15 2019, 4:47 AM
kadircet marked 6 inline comments as done.

Address comments

kadircet added inline comments.Feb 15 2019, 5:24 AM
unittests/Index/IndexTests.cpp
66

it was left over of a copy paste, we don't even need subtraction.

kadircet updated this revision to Diff 187014.Feb 15 2019, 6:54 AM
  • Get rid of redundant test
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2019, 3:30 AM