Граф коммитов

14 Коммитов

Автор SHA1 Сообщение Дата
Dmitri Gribenko 5694feb5cc libclang: factor out the frequent pattern static_cast<ASTUnit *>(TU->TUData)
into a getter cxtu::getASTUnit(TU)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173585 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 18:53:38 +00:00
Dmitri Gribenko e22339c44b libclang: change return type of getCursorDecl() to 'const Decl *'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173278 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 17:25:27 +00:00
Chandler Carruth b1ba0efc3d Re-sort all the headers. Lots of regressions have crept in here.
Manually fix the order of UnwrappedLineParser.cpp as that one didn't
have its associated header as the first header.

This also uncovered a subtle inclusion order dependency as CLog.h didn't
include LLVM.h to pick up using declarations it relied upon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19 08:09:44 +00:00
Dmitri Gribenko acbe4ba0be Replace more usages of __func__ with LLVM_FUNCTION_NAME
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172161 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 02:23:13 +00:00
Argyrios Kyrtzidis c6f5c6a58d [libclang] Enhance logging capabilities of libclang.
-provide a "raw_ostream'ish" class to make it convenient to output logging info.
-use macros to automate a bit the logging functionality inside libclang functions
-when logging, print a stack trace if "LIBCLANG_LOGGING=2" environment is set.
-add logging to more functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10 18:54:52 +00:00
Argyrios Kyrtzidis 664b06f9bd [libclang] When getting the cursor for an identifier inside a macro definition, check if
this was ever a macro name and return a specific CXCursor_MacroExpansion cursor in such a case,
instead of the generic CXCursor_MacroDefinition.

Checking for macro name makes sure the identifier is not part of the identifier list in a
function macro.
While, in general, resolving identifiers in macro definitions to other macros may not be completely accurate,
it greatly improves functionality such as give-me-the-definition-of-this, which was not working at all
inside macro definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171773 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07 19:16:25 +00:00
Chandler Carruth f59edb96b2 Sort #include lines for tools/...
Completely automated with sort_includes.py

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169240 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-04 09:25:21 +00:00
Argyrios Kyrtzidis 16ed0e6fda [libclang] Add defensive checks to make sure we don't try to dereference
a null pointer after getCursorDecl() is called. rdar://10298421.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146312 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-10 02:36:25 +00:00
Argyrios Kyrtzidis 4451746d8f [libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:17:49 +00:00
Argyrios Kyrtzidis e368a641a0 [libclang] When doing clang_findReferencesInFile, make sure we don't crash
if we come up against a null Decl.

No test case unfortunately. rdar://10457799.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 01:56:07 +00:00
Argyrios Kyrtzidis 5c2a1f741e [libclang] Do the ConcurrencyCheck at the beginning of clang_findReferencesInFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145455 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 23:21:50 +00:00
Argyrios Kyrtzidis b49e728a4d [libclang] Make clang_findReferencesInFile also work on macros (find all expansions/definition
of a macro in a file).

As a bonus, also make searching for declarations more efficient by ignoring
preprocessing entities when we know that we are looking for a declaration.

Fixes rdar://10427411.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-29 03:14:11 +00:00
Argyrios Kyrtzidis e2079cf54d [libclang] Make clang_findReferencesInFile use "file-targeted" deserialization and avoid
unnecessary deserializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-16 08:58:54 +00:00
Argyrios Kyrtzidis aed123ec3c [libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.

rdar://7948304

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141277 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-06 07:00:54 +00:00