History log of /external/clang/test/Index/annotate-tokens-pp.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3453bf7da9ac88cd2421b7fdccebf5cd2b8a9d87 07-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When annotating preprocessor tokens, if we are in a macro definition,
check if the token was ever a macro name and annotate it if that's the case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
c059f89d888cd214e18ed09a7b47339201526381 07-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Simplify annotation of preprocessing tokens and remove the AnnotateTokensData
DenseMap and the lookups associated with it.

Instead of lexing for preprocessor tokens, associating the annotation with the location in a map,
and later lookup in the map in order to adjust the cursor annotation, just annotate the cursor
while lexing for preprocessor tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171775 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
b94b62c3b15967d29f63165e834fa4f12944394c 12-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Make sure tokens from preprocessor directives are annotated as such,
even if the directive is inside a declaration.

Fixes rdar://11548788 & http://llvm.org/PR12970

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
d7711ec430fde5706f85ba6c4b85283a8e743ff7 21-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg expanded
token locations as coming before the closing ')' of a function macro expansion.

Include a unit test for SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147056 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
42b2984771a7fd1b17c78bbb2c59fed3db2f1960 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
ee0f84fc84ed7de7975e102668d8e53a778f7a8c 26-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140519 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
50402470f07f720c509c8797f40a106a0d4af6a7 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For SourceManager::isBeforeInTranslationUnit, a location pointing
inside a macro argument should be regarded as coming before
the location of the expanded tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
8f7c540ac42370c40ebcdc4b69018c938faf94ec 08-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix annotation and getting a "macro expansion" cursor
for a builtin macro expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
a676379b26edc959193f9f919ba9c6d296a57824 18-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Annotate correctly macro argument tokens.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
9b2a0ac970a077bdc0bf08c6c682f80ad733c892 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Update all of the libclang code corresponding to the preprocessor
MacroInstantiation -> MacroExpansion rename. Internally, everything is
switched.

Introduce a new cursor kind enum with the new name, but retain the old
name as an alias so that we don't break backwards compatibility.

Also update the debug printing routine to use 'macro expansions' as its
explicitly not guaranteed to be stable, and mechanically switch the test
cases over to that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
dd3e5549e3c11e217078938aacf72f042eea5343 04-May-2011 Douglas Gregor <dgregor@apple.com> Introduce a new libclang API, clang_isFileMultipleIncludeGuarded(),
which determines whether a particular file is actually a header that
is intended to be guarded from multiple inclusions within the same
translation unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
a9b06d4c246d6c301e3dd1844f5dba669ed9c631 09-Nov-2010 Douglas Gregor <dgregor@apple.com> ntroduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a
macro. clang_getInstantiationLocation() tells where we instantiated
the macro.

I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs,
since they gloss over macro-instantiation information.

Take 2: this time, adjusted tests appropriately and used a "simple"
approach to the spelling location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
4419b675577d7c281a659fab1fec10e1bfbe04c5 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Improve the implementation of libclang's token-annotation logic for
entities in the preprocessing record. Previously, we would only end up
getting the first token of a preprocessing record annotated
correctly. For example, given

#include "foo.h"

we would only get the '#' annotated as an inclusion directive; the
'include' and '"foo.h"' tokens would be given the general 'processing
directive' annotation.

Now, we get proper annotations for entities in the preprocessing
record.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0ed 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
23bc11ff1874f8875426c9a8a29fe1e6894c3503 14-Aug-2010 Ted Kremenek <kremenek@apple.com> Always recurse into sub-cursors when annotating tokens, as this information is used for annotating macro arguments. This finishes up <rdar://problem/8044584>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
3f4046004be223b03f1f895bb934e44921ccf805 14-Aug-2010 Ted Kremenek <kremenek@apple.com> As a heuristic, annotate tokens (via clang_annotateTokens) that are the arguments of a macro instantiation using the closest cursor with the same spelling location. Because macro arguments can get token pasted in any arbitrary order, we use the annotation map to paper over the token -> cursor annotations during our post-processing stage. This fixes most of <rdar://problem/8044584>, but still doesn't work for assert().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
3c26684d0339a36915fd3b30e6df82fe618bb7a7 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Try to appease MSVC's standard library

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
1a1f85a9352cfad7035861a2c1bb92ac62e6e9cb 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Try to appease MSVC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
bf7efa2742dc94363d3561d284c9d634fc5a780f 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
572feb2a190b5e8b04fb06c4ac50ee0f61e93ff0 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
4ae8f298b1ea51b4c2234f9148e2e4349c9bdd23 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
4807231938d8aff28de09f78f301f9ba5845e5e4 18-Mar-2010 Douglas Gregor <dgregor@apple.com> More token-annotation experimentation, preprocessing the annotated
token sequence to detect macro instantiations (that produce at least
token). WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c
9f1e3ff3b3095967e2b92b57a53524e2d6bb141c 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Experimental stab at using relexing to identify preprocessor
directives while annotating tokens in CIndex. This functionality
should probably be factored out of this routine, but we're not there
yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Index/annotate-tokens-pp.c