Commit Graph

26 Commits

Author SHA1 Message Date
Ivan Donchevskii 4e24bae3a8 [libclang] Return the proper pointee type for 'auto' deduced to pointer
Currently the resulting type is always invalid in such case.

Differential Revision: https://reviews.llvm.org/D51281

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341656 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-07 13:23:51 +00:00
Emilio Cobos Alvarez 5c23dd5604 Remove leftover test expectation from rL301902.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301906 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 09:57:30 +00:00
Emilio Cobos Alvarez eb56e4e44e [libclang] Revert rL301328 and add tests for the regressions introduced.
Differential Revision: https://reviews.llvm.org/D32566



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 08:32:15 +00:00
Alex Lorenz 4eaf83fa60 [libclang] Check for a record declaration before a template specialization
Fixes PR32539.

Patch by Emilio Cobos Álvarez!

Differential Revision: https://reviews.llvm.org/D32348


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301328 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 16:59:07 +00:00
Alex Lorenz a024a336fe Print nested name specifiers for typedefs and type aliases
Printing typedefs or type aliases using clang_getTypeSpelling() is missing the
namespace they are defined in. This is in contrast to other types that always
yield the full typename including namespaces.

Patch by Michael Reiher!

Differential Revision: https://reviews.llvm.org/D29944


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-10 15:04:58 +00:00
Argyrios Kyrtzidis 559be57f7a [libclang] Restore the CXXRecordDecl path for 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
2016-12-16 21:40:16 +00:00
Argyrios Kyrtzidis 92a8e1a9b4 [libclang] Generalize clang_getNumTemplateArguments and clang_getTemplateArgumentAsType to other kind of specializations.
Patch by Emilio Cobos Álvarez!
https://reviews.llvm.org/D26663

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 20:51:46 +00:00
Sergey Kalinichev 7cd277a1ff [libclang] Expose the ElaboratedType
Differential Revision: http://reviews.llvm.org/D11797


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 06:58:29 +00:00
Jonathan Coe f376e8cf30 Expose cxx constructor and method properties through libclang and python 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
2016-04-27 12:48:25 +00:00
Sergey Kalinichev 93622ca0d4 [libclang] Expose AutoType
Expose the AutoType via LibClang and python bindings

Differential Revision: http://reviews.llvm.org/D13000


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-15 13:10:10 +00:00
Manuel Klimek 7f4ff5e222 [libclang] Return deduced type for auto type, not the one written in the source.
It used to work, but was accidentally broken by r179769.
The issue with decayed types was fixed by r190796.
So this patch partially reverts r179769, and adds more tests.

This also fixes PR 18669.

Patch by Sergey Kalinichev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-03 16:11:10 +00:00
Argyrios Kyrtzidis 11a6a5c1d6 [libclang] Add functions to get information about fields.
Patch by Loïc Jaquemet!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234762 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-13 16:55:04 +00:00
Rafael Espindola 4779beea00 This reverts commit r227432, r227438 and r227448.
It should bring the bots back.

Original messagses:

r227448:
   Remove unnecessary default.

r227438:
   Fix Index/print-type.cpp test following r227432.

r227432:
    libclang: Add three functions useful for dealing with anonymous fields:
       clang_Cursor_getOffsetOfField
       clang_Cursor_isAnonymous
       clang_Type_visitFields
    Python: Add corresponding methods for dealing with anonymous fields.

    Patch by Loïc Jaquemet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 17:22:53 +00:00
Francois Pichet c7f28ff021 Fix Index/print-type.cpp test following r227432.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227438 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 13:33:44 +00:00
Francois Pichet fa8a3bc3d0 libclang: Add three functions useful for dealing with anonymous fields:
clang_Cursor_getOffsetOfField
   clang_Cursor_isAnonymous
   clang_Type_visitFields
Python: Add corresponding methods for dealing with anonymous fields.

Patch by Loïc Jaquemet

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-29 12:45:29 +00:00
Anders Waldenborg a1afe2596b Handle difference in signedness of 'char' in test/Index/print-type.c{,pp}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205922 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 19:39:07 +00:00
Anders Waldenborg c0fadbc7d9 Make c-index-test -test-print-type include pointeekind for pointer types
The idea is to give visibility to more type kinds, especially for getting
a better grasp of what appears as unexposed type kind with libclang.

Differential Revision: http://reviews.llvm.org/D3325


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205921 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-09 19:16:08 +00:00
Dmitri Gribenko 0b945e0ef2 libclang: New functions clang_Type_getNumTemplateArguments,
clang_Type_getTemplateArgument

Note that these functions don't handle variadic templates -- see tests.

Patch by Matthieu Nottale and Philippe Daouadi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 16:05:05 +00:00
Rafael Espindola bafcbe836c Switch to the new MingW ABI.
GCC 4.7 changed the MingW ABI. On the clang side this means that methods now
have the thiscall calling convention by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197164 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 16:07:11 +00:00
Argyrios Kyrtzidis 367e8fe3ef [libclang] Introduce clang_Type_getClassType which returns the class type of a member pointer type.
Patch by Che-Liang Chiou!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191906 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 16:19:23 +00:00
Argyrios Kyrtzidis 4c4f6fe2a6 [libclang] Expose the rest of the array types.
Patch by Che-Liang Chiou!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186967 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 17:36:21 +00:00
Reid Kleckner c910d4cfa5 Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"
This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183616 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 18:19:52 +00:00
Reid Kleckner 63c9a92a80 [Sema] Make FunctionType's TSI use unadjusted argument types
This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

Differential Revision: http://llvm-reviews.chandlerc.com/D883

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-08 17:28:56 +00:00
Argyrios Kyrtzidis 7717914639 [libclang] Report parameter array types as written in source, not decayed to pointer types.
Patch by Doug.
rdar://13684618

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18 16:41:15 +00:00
Argyrios Kyrtzidis 07c5908fa1 [libclang] Modify clang_getCursorType to be able to handle a function template decl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177359 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 23:54:50 +00:00
Dmitri Gribenko ae03d8e52d libclang: add clang_getTypeSpelling(CXType CT)
Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:15:49 +00:00