Commit Graph

313 Commits

Author SHA1 Message Date
Mike Stump e303c9e468 Prep for new warning.
llvm-svn: 76643
2009-07-21 21:06:08 +00:00
Argyrios Kyrtzidis 05ac8276cf Change the semantics for Entity.
Entity can now refer to declarations that are not visible outside the translation unit.
It is a wrapper of a pointer union, it's either a Decl* for declarations that don't
"cross" translation units, or an EntityImpl* which is associated with the specific "visible" Decl.

Included is a test case for handling fields across translation units.

llvm-svn: 76515
2009-07-21 00:07:06 +00:00
Argyrios Kyrtzidis 851b208a20 Use temporary output to avoid running index-test with the same commands multiple times.
llvm-svn: 76513
2009-07-21 00:06:46 +00:00
Argyrios Kyrtzidis ed53caebda Add comments to indicate why RUN lines are below the source code.
llvm-svn: 75813
2009-07-15 18:59:40 +00:00
Argyrios Kyrtzidis 9cbe886cff Move the RUN lines on the same file but below the code, as suggested by Sebastian.
llvm-svn: 75608
2009-07-14 05:34:59 +00:00
Argyrios Kyrtzidis 12563b8111 Handle redeclarations properly at the index-test tool.
llvm-svn: 75605
2009-07-14 03:20:31 +00:00
Argyrios Kyrtzidis d49e8dd759 Add a C++ indexing test case, where we show the references of overloaded '+' plus signs.
Ok, this is a bit out of place since C++ support is way way off, but it was just too cool to not show it off :-)

llvm-svn: 75601
2009-07-14 03:19:46 +00:00
Argyrios Kyrtzidis 2f0eff102c Handle struct fields through the index-test tool.
llvm-svn: 75596
2009-07-14 03:18:40 +00:00
Argyrios Kyrtzidis 558449bf79 Move the test input source code to a separate file.
That way we can freely add new RUN lines without having to correct the line part in all the -point-at options.

llvm-svn: 75595
2009-07-14 03:18:25 +00:00
Argyrios Kyrtzidis 1561c6cf54 Having tests that depend on previously created files is bad idea. Fix them to be self-sufficient.
llvm-svn: 74810
2009-07-06 00:03:47 +00:00
Argyrios Kyrtzidis 5641111e3f Make use of the Index library through the index-test tool.
'index-test' is now able to provide additional info for a Decl, through multiple AST files:
-Find declarations
-Find definitions
-Find references

llvm-svn: 74803
2009-07-05 22:22:35 +00:00
Douglas Gregor c6d5edd2ed Add support for retrieving the Doxygen comment associated with a given
declaration in the AST. 

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment, 
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile). 

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
  - We don't actually attempt to parse the comment blocks themselves,
  beyond identifying them as Doxygen comment blocks to associate them
  with a declaration.
  - We won't find comment blocks that aren't adjacent to the
  declaration, because we start our search based on the location of
  the declaration.
  - We don't go through the necessary hops to find, for example,
  whether some redeclaration of a declaration has comments when our
  current declaration does not. Similarly, we don't attempt to
  associate a \param Foo marker in a function body comment with the
  parameter named Foo (although that is certainly possible).
  - Verification of my "no performance impact" claims is still "to be
  done".

llvm-svn: 74704
2009-07-02 17:08:52 +00:00
Argyrios Kyrtzidis 92772215af Introduce tools/index-test.
This tool will be the test bed for indexing related operations. It basically reads PCH files passed by the command line and performs various operations.

Currently it can accept a file:line:column which resolves to a declaration/statement and displays some information about them.

llvm-svn: 74198
2009-06-25 18:22:52 +00:00