summaryrefslogtreecommitdiffstats
path: root/clang/tools/c-index-test
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang] Add PRIVATE to target_link_librariesShoaib Meenai2017-12-061-0/+1
| | | | | | | Another follow-up to r319840. I'd done a test configure with LLVM_BUILD_STATIC, so I'm not sure why this didn't show up in that. llvm-svn: 319983
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* [libclang] Record parsing invocation to a temporary file when requestedAlex Lorenz2017-12-041-0/+4
| | | | | | | | | | | | | | | | | | by client This patch extends libclang by allowing it to record parsing operations to a temporary JSON file. The file is deleted after parsing succeeds. When a crash happens during parsing, the file is preserved and the client will be able to use it to generate a reproducer for the crash. These files are not emitted by default, and the client has to specify the invocation emission path first. rdar://35322543 Differential Revision: https://reviews.llvm.org/D40527 llvm-svn: 319702
* [clang] Use add_llvm_install_targetsShoaib Meenai2017-11-301-5/+3
| | | | | | | | | | Use this function to create the install targets rather than doing so manually, which gains us the `-stripped` install targets to perform stripped installations. Differential Revision: https://reviews.llvm.org/D40675 llvm-svn: 319489
* [index] Generate class & metaclass manglings for objcDave Lee2017-09-221-4/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: ObjC classes have two associated symbols, one for the class and one for the metaclass. This change overloads `CodegenNameGenerator::getAllManglings` to produce both class and metaclass symbols. While this function is called by `clang_Cursor_getCXXManglings`, it's only called for CXXRecordDecl and CXXMethodDecl, and so libclang's behavior is unchanged. Reviewers: arphaman, abdulras, alexshap, compnerd Reviewed By: compnerd Subscribers: compnerd Differential Revision: https://reviews.llvm.org/D37671 llvm-svn: 313997
* [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 llvm-svn: 307771
* Revert r307769 (Forgot to mention the name of the contributor).Alex Lorenz2017-07-121-2/+0
| | | | llvm-svn: 307770
* [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 llvm-svn: 307769
* 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. llvm-svn: 306760
* [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 llvm-svn: 306483
* [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. llvm-svn: 305044
* [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! llvm-svn: 304212
* [libclang] Introduce clang_Cursor_isExternalSymbol that provides info about ↵Argyrios Kyrtzidis2017-05-101-0/+13
| | | | | | decls marked with external_source_symbol attribute llvm-svn: 302677
* [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 llvm-svn: 301648
* [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. llvm-svn: 301568
* [index] If the 'external_source_symbol' attribute indicates 'Swift' as the ↵Argyrios Kyrtzidis2017-04-241-0/+1
| | | | | | language then report it accordingly llvm-svn: 301183
* [c-index-test] Fix memory leak in c-index-test tool.Argyrios Kyrtzidis2017-03-211-0/+1
| | | | llvm-svn: 298441
* [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. llvm-svn: 298392
* [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 llvm-svn: 296282
* [c-index-test] For the 'core' invocation, avoid running it under a new thread.Argyrios Kyrtzidis2017-02-231-3/+3
| | | | | | It's unnecessary. llvm-svn: 295934
* Fix the static build.Rafael Espindola2017-02-151-0/+1
| | | | llvm-svn: 295245
* [c-index-test] CMake: add missing reference to clangSerialization library.Argyrios Kyrtzidis2017-01-301-0/+1
| | | | llvm-svn: 293466
* [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. llvm-svn: 293461
* [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. llvm-svn: 293416
* [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. llvm-svn: 291409
* 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. llvm-svn: 291270
* 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. llvm-svn: 291249
* IntrusiveRefCntPtr -> std::shared_ptr for CompilerInvocationBase and ↵David Blaikie2017-01-051-4/+3
| | | | | | CodeCompleteConsumer llvm-svn: 291184
* [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 llvm-svn: 289995
* [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 llvm-svn: 288438
* [index] Rename SymbolSubKind -> SymbolProperty, NFC.Argyrios Kyrtzidis2016-11-111-2/+2
| | | | | | This better reflects what it represents. llvm-svn: 286680
* 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 llvm-svn: 283671
* [c-index-test] Make sure to check that clang_Cursor_getNumTemplateArguments ↵Argyrios Kyrtzidis2016-07-301-2/+5
| | | | | | did not return -1. llvm-svn: 277261
* Update to match LLVM r272232.Richard Smith2016-06-092-5/+6
| | | | llvm-svn: 272233
* Indexer: add CXObjCPropertyAttr_class for class properties.Manman Ren2016-05-311-0/+1
| | | | | | rdar://25963227 llvm-svn: 271351
* 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>. llvm-svn: 271292
* Revert r253909 because it was committed with an incorrect messageEhsan Akhgari2016-05-311-30/+0
| | | | llvm-svn: 271291
* [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 llvm-svn: 268453
* 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 llvm-svn: 267706
* [index] Add a SymbolSubKind for an ObjC unit test.Argyrios Kyrtzidis2016-04-221-1/+2
| | | | llvm-svn: 267117
* [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. llvm-svn: 267116
* [c-index-test] Fix leak in print_completion_result, NFCVedant Kumar2016-04-031-3/+5
| | | | llvm-svn: 265252
* [c-index-test] Delete dead function, NFCVedant Kumar2016-03-301-19/+0
| | | | llvm-svn: 264874
* 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. llvm-svn: 262318
* [index] Print and test module import references.Argyrios Kyrtzidis2016-02-291-0/+20
| | | | llvm-svn: 262208
* [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. llvm-svn: 261445
* [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. llvm-svn: 260866
* [index] Factor libclang's functionality to determing the mangled name of ↵Argyrios Kyrtzidis2016-02-141-0/+10
| | | | | | symbols into the clangIndex library. llvm-svn: 260858
* Don't leak the ASTUnit when done with testing.Benjamin Kramer2016-02-141-3/+2
| | | | | | Found by lsan. llvm-svn: 260850
* c-index-test: Fix libdeps corresponding to r260841.NAKAMURA Takumi2016-02-141-0/+3
| | | | llvm-svn: 260847
OpenPOWER on IntegriCloud