summaryrefslogtreecommitdiffstats
path: root/tools/c-index-test
Commit message (Collapse)AuthorAgeFilesLines
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+2
| | | | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D35187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307771 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r307769 (Forgot to mention the name of the contributor).Alex Lorenz2017-07-121-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307770 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+2
| | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Differential Revision: https://reviews.llvm.org/D35187 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307769 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach ASTReader how to read only the Preprocessor state from an AST file, ↵Richard Smith2017-06-291-1/+1
| | | | | | | | | | not the ASTContext state. We use this when running a preprocessor-only action on an AST file in order to avoid paying the runtime cost of loading the extra information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306760 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Support for querying the exception specification type through ↵Jonathan Coe2017-06-271-0/+31
| | | | | | | | | | | | | | | | | | | libclang Summary: This patch exposes the exception specification type (noexcept, etc.) of a C++ function through libclang and Python clang.cindex. Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: jbcoe, cfe-commits Differential Revision: https://reviews.llvm.org/D34091 Patch by Andrew Bennieston git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306483 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce a new parsing option ↵Argyrios Kyrtzidis2017-06-091-0/+30
| | | | | | | | 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only. This is useful for parsing a single file, as a fast/inaccurate 'mode' that can still provide declarations from the file, like the classes and their methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305044 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Allow to suspend a translation unit.Erik Verbruggen2017-05-301-0/+2
| | | | | | | | | | | | | | | | | | A suspended translation unit uses significantly less memory but on the other side does not support any other calls than clang_reparseTranslationUnit to resume it or clang_disposeTranslationUnit to dispose it completely. This helps IDEs to reduce the memory footprint. The data that is freed by a call to clang_suspendTranslationUnit will be re-generated on the next (re)parse anyway. Used with a preamble, this allows pretty fast resumption of the translation unit for further use (compared to disposal of the translation unit and a parse from scratch). Patch by Nikolai Kosjar! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304212 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce clang_Cursor_isExternalSymbol that provides info about ↵Argyrios Kyrtzidis2017-05-101-0/+13
| | | | | | decls marked with external_source_symbol attribute git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302677 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Expose some target information via the C API.Emilio Cobos Alvarez2017-04-281-2/+50
| | | | | | | | | | | | | This allows users to query the target triple and target pointer width, which would make me able to fix https://github.com/servo/rust-bindgen/issues/593 and other related bugs in an elegant way (without having to manually parse the target triple in the command line arguments). Differential Revision: https://reviews.llvm.org/D32389 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301648 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Enhance clang_Cursor_isDynamicCall and ↵Argyrios Kyrtzidis2017-04-271-4/+7
| | | | | | | | clang_Cursor_getReceiverType to handle ObjC property references Also enhance clang_Cursor_getReceiverType to handle C++ method calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301568 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] If the 'external_source_symbol' attribute indicates 'Swift' as the ↵Argyrios Kyrtzidis2017-04-241-0/+1
| | | | | | language then report it accordingly git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301183 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Fix memory leak in c-index-test tool.Argyrios Kyrtzidis2017-03-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298441 91177308-0d34-0410-b5e6-96231b3b80d8
* [index/AST] Determine if a typedef shares a name and spelling location with ↵Argyrios Kyrtzidis2017-03-211-0/+9
| | | | | | | | | | its underlying tag type In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent', meaning we treat its references as symbols of the underlying tag symbol. Also provide a libclang API to check for such typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298392 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add 'Parameter' symbol kind and 'Local' symbol property to ↵Argyrios Kyrtzidis2017-02-261-2/+7
| | | | | | | | | | | | distinguish function-local symbols Parameters have a 'child' relation to their function/method. Also add an option '-include-locals' to 'c-index-test core' to enable indexing of function-local symbols. Original patch from Nathan Hawes with some changes by me. https://reviews.llvm.org/D30304 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@296282 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] For the 'core' invocation, avoid running it under a new thread.Argyrios Kyrtzidis2017-02-231-3/+3
| | | | | | It's unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295934 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the static build.Rafael Espindola2017-02-151-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295245 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] CMake: add missing reference to clangSerialization library.Argyrios Kyrtzidis2017-01-301-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293466 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Provide capability to index module file imports and dump ↵Argyrios Kyrtzidis2017-01-301-3/+32
| | | | | | | | their input files. This ensures the capability to index a module file using an existing ASTReader from a compiler instance or ASTUnit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293461 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Provide capability for 'c-index-test core' to dump symbol ↵Argyrios Kyrtzidis2017-01-292-0/+46
| | | | | | information from a PCH/module file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293416 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Introduce SymbolSubKind for reporting language-specific details.Argyrios Kyrtzidis2017-01-081-0/+2
| | | | | | Initially reports if a constructor symbol is a copy or move constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291409 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase ↵David Blaikie2017-01-061-3/+2
| | | | | | | | | | | | | | and CodeCompleteConsumer" Aleksey Shlypanikov pointed out my mistake in migrating an explicit unique_ptr to auto - I was expecting the function returned a unique_ptr, but instead it returned a raw pointer - introducing a leak. Thanks Aleksey! This reapplies r291184, reverted in r291249. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291270 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-061-3/+4
| | | | | | | | | | CodeCompleteConsumer" Caused a memory leak reported by asan. Reverting while I investigate. This reverts commit r291184. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291249 91177308-0d34-0410-b5e6-96231b3b80d8
* IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-051-4/+3
| | | | | | CodeCompleteConsumer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291184 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Restore the CXXRecordDecl path for ↵Argyrios Kyrtzidis2016-12-161-15/+22
| | | | | | | | | clang_Type_getNumTemplateArguments and clang_Type_getTemplateArgumentAsType Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26907 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289995 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Add APIs to check the result of an integer expression in ↵Argyrios Kyrtzidis2016-12-011-2/+8
| | | | | | | | | CXEvalResult without overflow Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26788 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288438 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Rename SymbolSubKind -> SymbolProperty, NFC.Argyrios Kyrtzidis2016-11-111-2/+2
| | | | | | This better reflects what it represents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@286680 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn cl::values() (for enum) from a vararg function to using C++ variadic ↵Mehdi Amini2016-10-081-2/+1
| | | | | | | | | | | | | | | template The core of the change is supposed to be NFC, however it also fixes what I believe was an undefined behavior when calling: va_start(ValueArgs, Desc); with Desc being a StringRef. Differential Revision: https://reviews.llvm.org/D25342 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283671 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments ↵Argyrios Kyrtzidis2016-07-301-2/+5
| | | | | | did not return -1. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@277261 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to match LLVM r272232.Richard Smith2016-06-092-5/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272233 91177308-0d34-0410-b5e6-96231b3b80d8
* Indexer: add CXObjCPropertyAttr_class for class properties.Manman Ren2016-05-311-0/+1
| | | | | | | rdar://25963227 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271351 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-c: Add the clang_getCursorVisibility() APIEhsan Akhgari2016-05-311-0/+30
| | | | | | | | | This patch adds an API for querying the visibility of the entity referred to by a cursor. Patch by Michael Wu <mwu@mozilla.com>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271292 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r253909 because it was committed with an incorrect messageEhsan Akhgari2016-05-311-30/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271291 91177308-0d34-0410-b5e6-96231b3b80d8
* [scan-build] fix dead store warnings emitted on clang code baseDavid Blaikie2016-05-031-2/+2
| | | | | | | | | | | | | This fixes dead store warnings of the type "dead assignment" reported by CLang Static Analyzer on the following file: - tools/c-index-test/c-index-test.c. Patch by Apelete Seketeli <apelete@seketeli.net>! Differential Revision: http://reviews.llvm.org/D19831 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268453 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose cxx constructor and method properties through libclang and python ↵Jonathan Coe2016-04-271-1/+12
| | | | | | | | | | | | | | | | | | | | | | | bindings. Summary: I have exposed the following function through libclang and the clang.cindex python bindings: clang_CXXConstructor_isConvertingConstructor, clang_CXXConstructor_isCopyConstructor, clang_CXXConstructor_isDefaultConstructor, clang_CXXConstructor_isMoveConstructor, clang_CXXMethod_isDefaulted I need (some of) these methods for a C++ code model I am building in Python to drive a code generator. Reviewers: compnerd, skalinichev Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15469 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267706 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Add a SymbolSubKind for an ObjC unit test.Argyrios Kyrtzidis2016-04-221-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267117 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.Argyrios Kyrtzidis2016-04-221-2/+3
| | | | | | This provides a more general and flexible way to annotate special symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267116 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Fix leak in print_completion_result, NFCVedant Kumar2016-04-031-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265252 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Delete dead function, NFCVedant Kumar2016-03-301-19/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264874 91177308-0d34-0410-b5e6-96231b3b80d8
* Optionally demote fatal errors to non-fatal errors.Manuel Klimek2016-03-011-0/+2
| | | | | | | | | | | | | | | | | | This behavior is enabled when the new CXTranslationUnit_KeepGoing option is passed to clang_parseTranslationUnit{,2}. It is geared towards use by IDEs and similar consumers of the clang-c API where fatal errors may arise when parsing incomplete code mid-edit, or when include paths are not properly configured yet. In such situations one still wants to get as much information as possible about a TU. Previously, the semantic analysis would not instantiate templates or report additional fatal errors after the first fatal error was encountered. Fixes PR24268. Patch by Milian Wolff. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262318 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Print and test module import references.Argyrios Kyrtzidis2016-02-291-0/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262208 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] CMake: When installing c-index-test to a different prefix ↵Argyrios Kyrtzidis2016-02-201-0/+2
| | | | | | | | directory, add an rpath so that it can find libclang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261445 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST/index] Introduce an option 'SuppressTemplateArgsInCXXConstructors' in ↵Argyrios Kyrtzidis2016-02-151-4/+1
| | | | | | | | | | printing policy. Enable it for USRs and names when indexing. Forward references can have different template argument names; including them makes USRs and names unstable, since the name depends on whether we saw a forward reference or not. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260866 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Factor libclang's functionality to determing the mangled name of ↵Argyrios Kyrtzidis2016-02-141-0/+10
| | | | | | symbols into the clangIndex library. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260858 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't leak the ASTUnit when done with testing.Benjamin Kramer2016-02-141-3/+2
| | | | | | Found by lsan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260850 91177308-0d34-0410-b5e6-96231b3b80d8
* c-index-test: Fix libdeps corresponding to r260841.NAKAMURA Takumi2016-02-141-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260847 91177308-0d34-0410-b5e6-96231b3b80d8
* [c-index-test] Fix a gcc build error.Argyrios Kyrtzidis2016-02-141-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260844 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Fix gcc builds.Argyrios Kyrtzidis2016-02-141-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260843 91177308-0d34-0410-b5e6-96231b3b80d8
* [index] Enhance c-index-test tool and have it link and test the clangIndex ↵Argyrios Kyrtzidis2016-02-143-4/+220
| | | | | | library directly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260842 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove autoconf supportChris Bieneman2016-01-261-58/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258862 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Introduce APIs for evaluating a cursor and checking if a macro is ↵Argyrios Kyrtzidis2016-01-161-70/+195
| | | | | | | | builtin/function. rdar://24091595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257968 91177308-0d34-0410-b5e6-96231b3b80d8