Gregory Szorc
6e67eed327
[clang.py] Implement TypeKind.spelling
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-15 18:51:10 +00:00
Gregory Szorc
5cc6787b1c
[clang.py] Implement Cursor.objc_type_encoding
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152513 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 22:23:27 +00:00
Gregory Szorc
1f1988fe75
[clang.py] Refactor get_tu and get_cursor test helper functions into util.py
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152510 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-10 22:19:05 +00:00
Gregory Szorc
9d008fd572
[clang.py] Return bool from Cursor.__eq__
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 00:42:15 +00:00
Gregory Szorc
e75f33063e
[clang.py] Test Cursor.__ne__
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151504 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-26 21:56:32 +00:00
Gregory Szorc
8261345a32
[clang.py] Format and add documention for Type
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150972 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 17:58:40 +00:00
Gregory Szorc
0e1f4f8de5
[clang.py] Add tests for Type.is_volatile_qualified and Type.is_restrict_qualified
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150971 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 17:58:02 +00:00
Gregory Szorc
826fce53d6
[clang.py] Implement Type.argument_types()
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 17:45:30 +00:00
Gregory Szorc
7eb691a7b6
[clang.py] Implement Type.__eq__ and Type.__ne__
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150969 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 17:44:49 +00:00
Gregory Szorc
31cc38cb76
[clang.py] Implement Type.is_function_variadic
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150936 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 18:28:33 +00:00
Gregory Szorc
bf8ca0049e
[clang.py] Implement Type.element_count
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 07:47:38 +00:00
Gregory Szorc
860576050b
[clang.py] Implement Type.element_type
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150799 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17 07:44:46 +00:00
Gregory Szorc
96ad633771
[clang.py] Implement Type.is_pod
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149842 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 19:42:06 +00:00
Tobias Grosser
2d10680fe1
[clang.py] Change type -> Type
...
Names that have corresponding classes in python are commonly started with an
uppercase letter. Let's follow that convention.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149831 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 12:15:56 +00:00
Tobias Grosser
eb9ff2ea9e
[clang.py] Implement Cursor.enum_type
...
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149830 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:42:25 +00:00
Tobias Grosser
28d939ffd6
[clang.py] Implement Cursor.underlying_typedef_type
...
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:42:20 +00:00
Tobias Grosser
250d217586
[clang.py] add TypeKind.VECTOR
...
Added a missing enumeration.
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149828 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:42:14 +00:00
Tobias Grosser
eb13634e39
[clang.py] Add CursorKind.{is_translation_unit, is_preprocessing, is_unexposed}
...
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149827 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:42:09 +00:00
Tobias Grosser
64e7bdc1d4
[clang.py] Implement Cursor.hash
...
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:42:03 +00:00
Tobias Grosser
ea403825fa
[clang.py] Expose diagnostic category and option info to Python binding
...
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:41:58 +00:00
Tobias Grosser
74858335a1
[clang.py] Implement __eq__ and __ne__ on SourceLocation and SourceRange
...
There is no type checking in __eq__, so ctypes will throw if the wrong
Python type is passed in to the C function. Personally, I feel garbage
in means garbage out and it isn't worth testing for this explicitly.
Contributed by: Gregory Szorc <gregory.szorc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-05 11:40:59 +00:00
Rafael Espindola
bf3cc73db9
Add CXX_FINAL_ATTR, CXX_OVERRIDE_ATTR, ANNOTATE_ATTR and ASM_LABEL_ATTR to the
...
python bindinds.
patch by Tom Schuster!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-30 15:27:22 +00:00
Benjamin Kramer
ffbe9b9c64
Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.
...
Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-23 17:00:35 +00:00
Tobias Grosser
ba5d10b82b
cindex.py: Remove more ternary operator + whitespace fixes
...
Another batch of ternary operators and some whitespace fixes
(Getting in sync with the clang_complete version of this file)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143330 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 02:06:50 +00:00
Tobias Grosser
8198288f4e
clang.py: Remove use of ternary operators
...
This change is necessary to make this file python 2.4 compatible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143324 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 00:49:07 +00:00
Tobias Grosser
58ba8c9f18
cindex.py: Allow to create a cursor from file/row/column
...
We add a constructor to create a SourceLocation from a position in
a file and we use this SourceLocation to retrieve a cursor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143322 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 00:31:32 +00:00
Tobias Grosser
a9ea5df14a
cindex.py: Add File.create_from_name()
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143321 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-31 00:07:19 +00:00
Douglas Gregor
13102ffbb0
Add support for constant arrays, from Anders Waldenborg!.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142477 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 05:51:43 +00:00
Douglas Gregor
38d2d5539e
Add TypeKind.CONSTANTARRAY, from Anders Waldenborg!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142476 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 05:50:34 +00:00
Douglas Gregor
9d342ab031
Fix error message for unknown type kind, from Anders Waldenborg!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142475 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 05:49:29 +00:00
Douglas Gregor
2abfec3240
This new field was introduced in clang-c in r141277
...
Python needs this in its structure definition so it allocates enough
memory. From Anders Waldenborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142474 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-19 05:47:46 +00:00
Douglas Gregor
42b2984771
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
2011-10-05 19:00:14 +00:00
Douglas Gregor
888982e42b
Update python testcase for GNU old-style field designator warning,
...
from Anders Waldenborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 00:16:30 +00:00
Douglas Gregor
b60a2bebb5
Add support for Cursor.displayname in python bindings, from Anders Waldenborg!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138785 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 00:15:34 +00:00
Argyrios Kyrtzidis
6b04623bcc
[python] Fix bug of the SourceLocation binding.
...
Patch by Anders Waldenborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 17:20:24 +00:00
Argyrios Kyrtzidis
2312f5f4df
[python] Add test_type.py by Anders Waldenborg, which I forgot to commit in r137797.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137828 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 17:01:10 +00:00
Argyrios Kyrtzidis
d7933e6f29
[python] Add support for CXType to python bindings.
...
Patch by Anders Waldenborg!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 00:43:03 +00:00
Douglas Gregor
8be80e1e6e
Improve the Python bindings for libclang in a few ways, from Eli
...
Bendersky. Specifically:
* Implemented a new function in libclang: clang_isAttribute
* Fixing TranslationUnit.get_includes to only go through the argument
* buffer when it contains something. This fixed a crash on Windows
* clang_getFileName returns CXString, not char*. Made appropriate
* fixes in cindex.py - now the relevant tests pass and we can see the
* full locations correctly again (previously there was garbage in
* place of the file name)
* Exposed clang_getCursorDisplayName to the python bindings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134460 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-06 03:00:34 +00:00
Tobias Grosser
a87dbcc049
python bindings: Add support for different kind of completion chunks
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:54:10 +00:00
Tobias Grosser
6d2a40c191
python bindings: Get the string representation of a CompletionChunk
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124958 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:54:07 +00:00
Tobias Grosser
0a16680067
python bindings: Add CodeCompletionResults
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:54:04 +00:00
Tobias Grosser
265e6b2d17
python bindings: Add support for translationUnit.reparse().
...
This is the first step to make the clang_complete vim plugin work with
libclang. Reparsing improves parsing time from 0.8 to 0.25 secs for
one of my LLVM .cpp files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124956 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:54:00 +00:00
Tobias Grosser
88f9c6ca6e
python bindings: Include local headers the right way.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:53:55 +00:00
Tobias Grosser
f784ff0c8a
python bindings: Remove unneeded instruction
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124954 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:53:53 +00:00
Tobias Grosser
f498e00a30
python bindings: fix Diagnostics.range iterator
...
The iterator did never throw an IndexError. It was therefore not possible
to use it in a normal foreach loop as that loop would never stop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:53:51 +00:00
Tobias Grosser
ff090ca42a
python bindings: Use python Diagnostics as function arguments
...
This improves the readability of the code and fixes one testsuite bug.
The bug happend, because we only stored the pointer to the diagnostic in the
FixIt iterator, but not the python Diagnostic object. So it could happen that
the FixIt iterator still exists, but the python Diagnostic object is freed.
However, as the python Diagnostic is freed the pointer to the diagnostic is also
freed and the FixIt iterator is referencing a freed pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:53:48 +00:00
Tobias Grosser
4ed73ce03b
python bindings: Synchronize cursor kinds
...
clang-c/Index.h contained cursor kinds not yet available in the python bindings.
Contributed-By: jmuizelaar@mozilla.com
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124951 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 17:53:47 +00:00
Daniel Dunbar
f51f20fa34
Rename 'CIndex' to 'libclang', since it has basically become our stable public
...
(C) API, and will likely grow further in this direction in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-30 21:51:10 +00:00
Benjamin Kramer
1d02ccd1aa
Rename the new Iterator objects and raise an assertion instead of returning invalid objects when the key is out of range.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 15:38:03 +00:00
Benjamin Kramer
3b0cf09f9c
Update the python bindings for recent changes in the CIndex API.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-06 14:53:07 +00:00