aboutsummaryrefslogtreecommitdiff
path: root/bindings
AgeCommit message (Collapse)Author
2013-04-21Fix return type of isBitfield in the binding definitionDmitri Gribenko
Patch by Loïc Jaquemet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179984 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-11[libclang] Expose record layout info via new libclang functions:Argyrios Kyrtzidis
clang_Type_getAlignOf clang_Type_getSizeOf clang_Type_getOffsetOf clang_Cursor_isBitField Patch by Loïc Jaquemet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19cindex.py: Handle NULL pointers when parsing translation unitsTobias Grosser
The code inside cindex.py was comparing NULL pointer returned by clang_parseTranslationUnit and clang_createTranslationUnit with None. However, as illustrated by the two tests I've added, those conditions were ineffective which resulted in assert triggering later on. Instead, a pointer is now treated as a boolean value, a NULL pointer being False. Contributed-by: Xavier Deguillard <deguilx@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26doxygen command. Add 'attention' command to list of similarFariborz Jahanian
doxygen commands. // rdar://12379053 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176127 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01Comment parsing: improve the fidelity of XML output for many block commandsDmitri Gribenko
This change introduces a 'kind' attribute for the <Para> tag, that captures the kind of the parent block command. For example: \todo Meow. used to be just <Para>Meow.</Para>, but now it is <Para kind="todo">Meow.</Para> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174216 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-01Fix indentDmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174201 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31[Comment parsing] Add support for recognizingFariborz Jahanian
\headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174109 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20[cindex.py]: Use spaces instead of tabsTobias Grosser
The tabs slipped in accidentally. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19[cindex.py] Add cache for CompletionChunk spellingsTobias Grosser
Most of the CompletionChunks represent braces, colons or other one character spellings. There is no need to call libclang, to figure out how to write a colon. Instead we use an internal cache to retrieve the correct spelling. As function calls from python are very expensive and this is a performance critical part of auto completion this patch makes formatting of auto completion results a lot faster. Formatting time changes from 0.57 to 0.45 seconds git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172901 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19[cindex.py] Replace CachedProperty with our own implementationTobias Grosser
This is a very performance critical point for auto completion. The manual implementation gives a large speedup. As it does not complicate the code a lot, I figured it is worth the change. If anybody understands why the CachedProperty is here so much slower, I am very interested in working on an improvement of CachedProperty. Formatting time changes from 0.72 to 0.57 seconds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172900 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19[cindex.py]: Speed up lookup of the completion kindTobias Grosser
We can directly the number of the kind instead of going through the completionChunkKindMap. Formatting time changes from 0.84 to 0.72 seconds. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02[python bindings] Expose cursor.referenced (clang_getCursorReferenced).Argyrios Kyrtzidis
Patch by Matthew King! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171423 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-11Fix a copypasto bug. Also rename the parameter in question to not shadow theMatt Beaumont-Gay
'file' builtin, and fix up a docstring a little. Hat tip to Sebastian Kreft Carreno at Google for noticing the bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01[clang.py] Add Cursor.get_arguments()Gregory Szorc
Patch provided by Matthias Kleine <matthias_kleine@gmx.de> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167216 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-17[Doc parsing]: This patch adds <Declaration> tag to Fariborz Jahanian
XML comment for declarations which pretty-prints declaration. I had to XFAIL one test annotate-comments.cpp. This test is currently unmaintainable as written. Dmitri G., can you see what we can do about this test. We should change this test such that adding a new tag does not wreck havoc to the test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07Python bindings: fix typo.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165375 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-07Python bindings: Add missing availability kind.Benjamin Kramer
Patch by Leo Liu, test case by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165374 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-03Comment to XML conversion: escape XML special chars correctly; use correctDmitri Gribenko
regex for version tuples. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[Doc parse]: SUpport for message in deprecated/unavailableFariborz Jahanian
attribute going iinto XML document. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[Doc parsing]: Add available and deprecated attribute infoFariborz Jahanian
to XML output. // rdar://12378879 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165039 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-01availability in structured documents. TakesFariborz Jahanian
care of comments by Dimitri and Doug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-29Comment XML schema: correct indentation.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164889 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-28[Doc parsing] Add availability information to generated Comment XML.Fariborz Jahanian
(I still need to add a test once I figure it out). Reviewed off-line by Doug. // rdar://12378879 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164861 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-22Fix cindex.py compatibility with older libclang.soDmitri Gribenko
The issue is that we were calling clang_getCompletionBriefComment unconditionally. New we check if this function is available before calling it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164464 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-15Add bindings for clang_getCompletionBriefComment to cindex.py.Dmitri Gribenko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163966 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-13Comment to XML conversion: we try not to emit empty <Discussion> elements, butDmitri Gribenko
it is not possible to guarantee that without duplicating logic or buffering <Discussion> element contents. So, allow empty <Discussion> elements in schema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163842 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-05[cindex.py] Make the use of a compatibilty check explicitTobias Grosser
At the moment, we implictly check compatibility between the python bindings and libclang, as the python bindings will fail to load in case a method we use in libclang is not available. This patch makes the use of this compatibility check explicit and introduces a flag to optionally disable the check. This will allow us to further harden the compatibility check, but it also gives the user the possibility to disable the compatibility check to evaluate compatibility with older libclang versions. I added documentation that makes clear the python bindings are only tested with the libclang version they have been shipped with. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163238 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-03[cindex.py] Allow to configure the path of libclangTobias Grosser
By calling cindex.Config.set_library_path(path) or cindex.Config.set_library_file(file) it is possible to specify from where we load libclang. This fixes an open FIXME. We also point the user to these functions, in case libclang can not be loaded sucessfully. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163121 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-01[cindex.py] Add helper to initialize libclang functionsTobias Grosser
The helper allows us to define how the initialization of functions should behave. We use this patch to provide an informative error message, in case a function is not available: "LibclangError: /home/grosser/Projekte/llvm/install/lib/libclang.so: undefined symbol: clang_method_added_in_2020. Please ensure that your python bindings are compatible with your libclang.so version." This patch also ensures that no spelling mistakes slip into the library initialization. At the moment, there are a couple of 'argtype' -> 'argtypes' mispellings that have been overlooked. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20[cindex.py] Cache the number of chunks in CompletionStringTobias Grosser
Without this patch, lib.clang_getNumCompletionChunks is called at each _iteration_ of a 'for chunk in CompletionString' loop. Now we call it just once. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162200 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-19[cindex.py] Add CachedProperty to CompletionChunkTobias Grosser
Suggested by: Francisco Lopes <oblita@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162191 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-19[clang.py] Add CachedProperty decoratorGregory Szorc
It isn't used anywhere yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162190 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-18[cindex.py] Use spaces, not tabs for indentationTobias Grosser
Reported by: Francisco Lopes <oblita@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162182 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-18[cindex.py] Dispose code completion results properlyTobias Grosser
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162181 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08Comment XML: use xml:space="preserve" in Verbatim tags, so that XML tidy doesDmitri Gribenko
not compress spaces in verbatim content. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161531 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07Comment AST: DeclInfo: add a special kind for enums.Dmitri Gribenko
Comment XML: add a root node kind for enums. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-07libclang API for comment-to-xml conversion.Dmitri Gribenko
The implementation also includes a Relax NG schema and tests for the schema itself. The schema is used in c-index-test to verify that XML documents we produce are valid. In order to do the validation, we add an optional libxml2 dependency for c-index-test. Credits for CMake part go to Doug Gregor. Credits for Autoconf part go to Eric Christopher. Thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161431 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12[clang.py] Implement Token APIGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160111 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12[clang.py] Add TranslationUnit.get_{file,source_location,source_range}Gregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-12[clang.py] Refactor how ctypes functions are registeredGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-10[cindex.py] Make CompileCommand.arguments usage consistent with ↵Arnaud A. de Grandmaison
CompileCommand.directory and the rest of the python binding Patch by David Röthlisberger git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-09[cindex.py] fix infinite iteration of compilation database CompileCommandsArnaud A. de Grandmaison
Patch by David Röthlisberger git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159926 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-06[cindex.py] Fix erroneous comment for CompileCommandsArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159810 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03[libclang] CompilationDatabase naming and comment fixesArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-30[cindex.py] Fix commentsArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159492 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-30[cindex.py] add CompilationDatabase supportArnaud A. de Grandmaison
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159485 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-11[clang.py] Implement SourceLocation.from_offsetGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-09[clang.py] Implement Cursor.is_static_methodGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158277 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-08Fix typo "CursorKind.CONDITONAL_OPERATOR" in Python bindings, fromDouglas Gregor
Manish Verma! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158182 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-15[clang.py] Store reference to TranslationUnit in Cursor and TypeGregory Szorc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156846 91177308-0d34-0410-b5e6-96231b3b80d8