summaryrefslogtreecommitdiffstats
path: root/clang/include/clang-c
Commit message (Collapse)AuthorAgeFilesLines
...
* [libclang] Add clang_File_tryGetRealPathNameFangrui Song2018-04-071-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: clang_getFileName() may return a path relative to WorkingDir. On Arch Linux, during clang_indexTranslationUnit(), clang_getFileName() on CXIdxIncludedIncludedFileInfo::file may return "/../lib64/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/string", for `#include <string>`. I presume WorkingDir is somehow changed to /usr/lib or /usr/include and clang_getFileName() returns a path relative to WorkingDir. clang_File_tryGetRealPathName() returns "/usr/include/c++/7.3.0/string" which is more useful for the indexer in this case. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42893 llvm-svn: 329515
* Fix typos in clangAlexander Kornienko2018-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [libclang] Add `CXSymbolRole role` to CXIdxEntityRefInfoFangrui Song2018-02-121-1/+27
| | | | | | | | | | | | | | | | | | Summary: CXIdxEntityRefInfo contains the member `CXIdxEntityRefKind kind;` to differentiate implicit and direct calls. However, there are more roles defined in SymbolRole. Among them, `Read/Write` are probably the most useful ones as they can be used to differentiate Read/Write occurrences of a symbol for document highlight in a text document. See `export namespace DocumentHighlightKind` on https://microsoft.github.io/language-server-protocol/specification Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42895 llvm-svn: 324914
* [CodeComplete] only respect LoadExternal hint at namespace/tu scopeSam McCall2018-01-241-3/+3
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42428 llvm-svn: 323347
* Add missing CINDEX_LINKAGEIvan Donchevskii2018-01-161-4/+4
| | | | | | | | Follow up for [libclang] Add PrintingPolicy for pretty printing declarations Differential Revision: https://reviews.llvm.org/D39903 llvm-svn: 322546
* [libclang] Add PrintingPolicy for pretty printing declarationsJonathan Coe2018-01-161-1/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Introduce clang_getCursorPrettyPrinted() for pretty printing declarations. Expose also PrintingPolicy, so the user gets more fine-grained control of the entities being printed. The already existing clang_getCursorDisplayName() is pretty limited - for example, it does not handle return types, parameter names or default arguments for function declarations. Addressing these issues in clang_getCursorDisplayName() would mean to duplicate existing code (e.g. clang::DeclPrinter), so rather expose new API to access the existing functionality. Reviewed By: jbcoe Subscribers: cfe-commits Tags: #clang Patch by nik (Nikolai Kosjar) Differential Revision: https://reviews.llvm.org/D39903 llvm-svn: 322540
* [CodeComplete] Add an option to omit results from the preamble.Sam McCall2018-01-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: Enumerating the contents of a namespace or global scope will omit any decls that aren't already loaded, instead of deserializing them from the PCH. This allows a fast hybrid code completion where symbols from headers are provided by an external index. (Sema already exposes the information needed to do a reasonabl job of filtering them). Clangd plans to implement this hybrid. This option is just a hint - callers still need to postfilter results if they want to *avoid* completing decls outside the main file. Reviewers: bkramer, ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41989 llvm-svn: 322371
* [libclang] Support querying whether a declaration is invalidIvan Donchevskii2018-01-041-1/+11
| | | | | | | | | | | | | | This is useful for e.g. highlighting purposes in an IDE. Note: First version of this patch was reverted due to failing tests in opencl-types.cl with -target ppc64le-unknown-linux. These tests are adapted now. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40072 llvm-svn: 321794
* Revert r321697 "[libclang] Support querying whether a declaration is ↵Hans Wennborg2018-01-031-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invalid" and follow-ups. This broke test/Index/opencl-types.cl on several buildbots: http://lab.llvm.org:8011/builders/clang-cmake-aarch64-lld/builds/3294 http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/6498 http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/5239 > [libclang] Support querying whether a declaration is invalid > > This is useful for e.g. highlighting purposes in an IDE. > > Patch by Nikolai Kosjar. > > Differential Revision: https://reviews.llvm.org/D40072 Also reverting follow-ups that otherwise caused conflicts for the revert: r321700 "Fix line endings." r321701 "Fix more line endings." r321698 "[libclang] Fix cursors for functions with trailing return type" > For the function declaration > > auto foo5(Foo) -> Foo; > the parameter tokens were mapped to cursors representing the > FunctionDecl: > > Keyword: "auto" [1:1 - 1:5] FunctionDecl=test5:1:6 > Identifier: "test5" [1:6 - 1:11] FunctionDecl=test5:1:6 > Punctuation: "(" [1:11 - 1:12] FunctionDecl=test5:1:6 > Identifier: "X" [1:12 - 1:13] FunctionDecl=test5:1:6 // Ops, not a TypeRef > Punctuation: ")" [1:13 - 1:14] FunctionDecl=test5:1:6 > Punctuation: "->" [1:15 - 1:17] FunctionDecl=test5:1:6 > Identifier: "X" [1:18 - 1:19] TypeRef=struct X:7:8 > Punctuation: ";" [1:19 - 1:20] > > Fix this by ensuring that the trailing return type is not visited as > first. > > Patch by Nikolai Kosjar. > > Differential Revision: https://reviews.llvm.org/D40561 llvm-svn: 321708
* Fix more line endings.Ivan Donchevskii2018-01-031-23/+23
| | | | llvm-svn: 321701
* [libclang] Support querying whether a declaration is invalidIvan Donchevskii2018-01-031-13/+23
| | | | | | | | | | This is useful for e.g. highlighting purposes in an IDE. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D40072 llvm-svn: 321697
* [libclang] Add support for checking abstractness of recordsAlex Lorenz2017-12-141-1/+7
| | | | | | | | | | | This patch allows checking whether a C++ record declaration is abstract through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D36952 llvm-svn: 320748
* [libclang] Add function to get the buffer for a fileErik Verbruggen2017-12-061-1/+16
| | | | | | | | | | This can be used by clients in conjunction with an offset returned by e.g. clang_getFileLocation. Now those clients do not need to also open/read the file. Differential Revision: https://reviews.llvm.org/D40643 llvm-svn: 319881
* [libclang] Record parsing invocation to a temporary file when requestedAlex Lorenz2017-12-041-0/+10
| | | | | | | | | | | | | | | | | | 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
* [index] Generate class & metaclass manglings for objcDave Lee2017-09-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | 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: expose `clang_getCursorTLSKind`Saleem Abdulrasool2017-09-131-0/+16
| | | | | | | | | | Introduce the 'TLS Kind' property of variable declarations through libclang. Additionally, provide a Python accessor for it, and test that functionality. Patch by Masud Rahman! llvm-svn: 313111
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-1/+2
| | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. llvm-svn: 312794
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-081-2/+1
| | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. llvm-svn: 312784
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-081-1/+2
| | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 llvm-svn: 312781
* [libclang] Fix PR34055 (incompatible update of clang-c/Index.h)Nikolai Bozhenov2017-08-081-0/+2
| | | | | | Fixes a regression introduced by r308218. llvm-svn: 310359
* [AArch64] Add support for __builtin_ms_va_list on aarch64Martin Storsjo2017-07-171-1/+1
| | | | | | | | | | | Move builtins from the x86 specific scope into the global scope. Their use is still limited to x86_64 and aarch64 though. This allows wine on aarch64 to properly handle variadic functions. Differential Revision: https://reviews.llvm.org/D34475 llvm-svn: 308218
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+5
| | | | | | | | | | | 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-5/+0
| | | | llvm-svn: 307770
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+5
| | | | | | | | | 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
* [libclang] Support for querying the exception specification type through ↵Jonathan Coe2017-06-271-1/+68
| | | | | | | | | | | | | | | | | | | 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
* [index] Fix typo: inferface -> interfaceMarc-Andre Laperle2017-06-162-2/+2
| | | | | | | | | | | | Reviewers: arphaman Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33253 llvm-svn: 305588
* [libclang] Introduce a new parsing option ↵Argyrios Kyrtzidis2017-06-091-2/+7
| | | | | | | | '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] Expose typedef and address space functionsSven van Haastregt2017-06-081-1/+11
| | | | | | | | | | | | Expose the following functions: - clang_getTypedefName - clang_getAddressSpace Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33598 llvm-svn: 304978
* [libclang] Allow to suspend a translation unit.Erik Verbruggen2017-05-301-1/+10
| | | | | | | | | | | | | | | | | 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] [OpenCL] Expose more OpenCL CIndex typesSven van Haastregt2017-05-231-2/+47
| | | | | | | | | | | | | | Expose pipe, sampler_t, clk_event_t, queue_t, reserve_id_t, and all image types. Update the opencl-types.cl test RUN line such that we can test the OpenCL 2.0 types. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33197 llvm-svn: 303626
* [libclang] Fix typo in doc-comment, NFCArgyrios Kyrtzidis2017-05-101-1/+1
| | | | llvm-svn: 302682
* [libclang] Introduce clang_Cursor_isExternalSymbol that provides info about ↵Argyrios Kyrtzidis2017-05-101-1/+18
| | | | | | decls marked with external_source_symbol attribute llvm-svn: 302677
* [libclang] Expose some target information via the C API.Emilio Cobos Alvarez2017-04-281-1/+37
| | | | | | | | | | | 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-2/+2
| | | | | | | | 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-1/+2
| | | | | | language then report it accordingly llvm-svn: 301183
* Avoid the -Wdocumentation-unknown-command warning in Clang's C API docsAlex Lorenz2017-04-061-3/+3
| | | | | | rdar://20441985 llvm-svn: 299650
* PR16106: Correct the docs to reflect the actual behavior of the interface.Vassil Vassilev2017-04-061-2/+2
| | | | llvm-svn: 299639
* [index/AST] Determine if a typedef shares a name and spelling location with ↵Argyrios Kyrtzidis2017-03-211-0/+10
| | | | | | | | | | 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
* [libclang] [OpenCL] Expose half type.Joey Gouly2017-02-101-1/+2
| | | | | | | | | | | | | | | | Expose the half type (fp16) through libclang and the python bindings. It seems CXType_LastBuiltin was not updated in b2ea6d9 ("Enable support for __float128 in Clang", 2016-04-13), so update it now. Add an Index test for OpenCL types; in the future we will add other OpenCL types such as images to this test. Patch by Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D29718 llvm-svn: 294754
* [OpenMP] Sema and parsing for 'target teams distribute simd’ pragmaKelvin Li2017-01-101-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute simd’ pragma. Differential Revision: https://reviews.llvm.org/D28252 llvm-svn: 291579
* [OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ ↵Kelvin Li2017-01-031-1/+5
| | | | | | | | | | pragma This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma. Differential Revision: https://reviews.llvm.org/D28202 llvm-svn: 290862
* [OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragmaKelvin Li2016-12-291-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma. Differential Revision: https://reviews.llvm.org/D28160 llvm-svn: 290725
* [OpenMP] Sema and parsing for 'target teams distribute' pragmaKelvin Li2016-12-251-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
* [OpenMP] Sema and parsing for 'target teams' pragmaKelvin Li2016-12-171-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'target teams' pragma. Differential Revision: https://reviews.llvm.org/D27818 llvm-svn: 290038
* Fix format and a few typos in comments.Samuel Antao2016-12-121-1/+1
| | | | llvm-svn: 289450
* [OpenMP] Sema and parsing for 'teams distribute parallel for' pragmaKelvin Li2016-12-091-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for' pragma. Differential Revision: https://reviews.llvm.org/D27345 llvm-svn: 289179
* [libclang] Add APIs to check the result of an integer expression in ↵Argyrios Kyrtzidis2016-12-011-1/+20
| | | | | | | | | CXEvalResult without overflow Patch by Emilio Cobos Álvarez! See https://reviews.llvm.org/D26788 llvm-svn: 288438
* [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragmaKelvin Li2016-11-301-1/+5
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma. Differential Revision: https://reviews.llvm.org/D27084 llvm-svn: 288294
* [libclang] Generalize clang_getNumTemplateArguments and ↵Argyrios Kyrtzidis2016-11-151-5/+2
| | | | | | | | | clang_getTemplateArgumentAsType to other kind of specializations. Patch by Emilio Cobos Álvarez! https://reviews.llvm.org/D26663 llvm-svn: 287024
* [index] Expose FriendDeclOlivier Goffart2016-11-041-2/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D26285 llvm-svn: 285984
OpenPOWER on IntegriCloud