[PATCH] D49476: [Index] Set OrigD before D is changed.

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 19 14:19:11 PDT 2018


ioeric added a comment.

In https://reviews.llvm.org/D49476#1168604, @akyrtzi wrote:

> `CXIndexDataConsumer.cpp` uses `ASTNode.OrigD`, that code is exercised when you run `c-index-test -index-file <...>`. I'd recommend to at least check if that command would produce a different output for the test case that you detected originally.


Thanks for the pointer!

I've given this a try but still didn't manage to come up with a test that would produce different outputs. Basically, what I'm trying to achieve is to get the original (implicit) template instantiation declarations from their references (see the added test case). This is hard to verify with c-index-test because 1) for declarations, although `OrigD` is used in the test, implicit instantiations are simply discarded (https://github.com/llvm-mirror/clang/blob/master/lib/Index/IndexingContext.cpp#L354) and 2) for references, c-index-test doesn't use OrigD to print symbol info.

Let me know if there is a better approach.


Repository:
  rC Clang

https://reviews.llvm.org/D49476





More information about the cfe-commits mailing list