<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Ok, I've asked Nikolai to recheck it on Linux and re-commited the rolled back change which is not connected with the failing one.</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> hwennborg@google.com <hwennborg@google.com> on behalf of Hans Wennborg <hans@chromium.org><br>
<b>Sent:</b> Wednesday, January 3, 2018 3:27:48 PM<br>
<b>To:</b> Ivan Donchevskii; cfe-commits<br>
<b>Subject:</b> Re: r321697 - [libclang] Support querying whether a declaration is invalid</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">I don't, but reverting your change made the test pass again.<br>
<br>
I was able to reproduce locally by adding -target<br>
ppc64le-unknown-linux to the run-line in test/Index/opencl-types.cl.<br>
<br>
On Wed, Jan 3, 2018 at 3:23 PM, Ivan Donchevskii <ivan.donchevskii@qt.io> wrote:<br>
> Hi!<br>
> I saw it but I don't see an issue in this change. Do you have an idea why<br>
> that happened?<br>
><br>
> ________________________________<br>
> From: hwennborg@google.com <hwennborg@google.com> on behalf of Hans Wennborg<br>
> <hans@chromium.org><br>
> Sent: Wednesday, January 3, 2018 3:21:52 PM<br>
> To: Ivan Donchevskii<br>
> Cc: cfe-commits<br>
> Subject: Re: r321697 - [libclang] Support querying whether a declaration is<br>
> invalid<br>
><br>
> This caused failures on the buildbots. I've reverted it and the<br>
> commits that depended on it in r321708. See that commit message for<br>
> more details.<br>
><br>
> On Wed, Jan 3, 2018 at 10:49 AM, Ivan Donchevskii via cfe-commits<br>
> <cfe-commits@lists.llvm.org> wrote:<br>
>> Author: yvvan<br>
>> Date: Wed Jan 3 01:49:31 2018<br>
>> New Revision: 321697<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=321697&view=rev">http://llvm.org/viewvc/llvm-project?rev=321697&view=rev</a><br>
>> Log:<br>
>> [libclang] Support querying whether a declaration is invalid<br>
>><br>
>> This is useful for e.g. highlighting purposes in an IDE.<br>
>><br>
>> Patch by Nikolai Kosjar.<br>
>><br>
>> Differential Revision: <a href="https://reviews.llvm.org/D40072">https://reviews.llvm.org/D40072</a><br>
>><br>
>> Modified:<br>
>> cfe/trunk/include/clang-c/Index.h<br>
>> cfe/trunk/test/Index/print-type-size.cpp<br>
>> cfe/trunk/tools/c-index-test/c-index-test.c<br>
>> cfe/trunk/tools/libclang/CIndex.cpp<br>
>> cfe/trunk/tools/libclang/libclang.exports<br>
>><br>
>> Modified: cfe/trunk/include/clang-c/Index.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=321697&r1=321696&r2=321697&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=321697&r1=321696&r2=321697&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/include/clang-c/Index.h (original)<br>
>> +++ cfe/trunk/include/clang-c/Index.h Wed Jan 3 01:49:31 2018<br>
>> @@ -29,13 +29,13 @@<br>
>> * CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking<br>
>> changes.<br>
>> *<br>
>> * The policy about the libclang API was always to keep it source and ABI<br>
>> - * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.<br>
>> - */<br>
>> -#define CINDEX_VERSION_MAJOR 0<br>
>> -#define CINDEX_VERSION_MINOR 45<br>
>> -<br>
>> -#define CINDEX_VERSION_ENCODE(major, minor) ( \<br>
>> - ((major) * 10000) \<br>
>> + * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.<br>
>> + */<br>
>> +#define CINDEX_VERSION_MAJOR 0<br>
>> +#define CINDEX_VERSION_MINOR 46<br>
>> +<br>
>> +#define CINDEX_VERSION_ENCODE(major, minor) ( \<br>
>> + ((major) * 10000) \<br>
>> + ((minor) * 1))<br>
>><br>
>> #define CINDEX_VERSION CINDEX_VERSION_ENCODE( \<br>
>> @@ -2638,12 +2638,22 @@ CINDEX_LINKAGE enum CXCursorKind clang_g<br>
>><br>
>> /**<br>
>> * \brief Determine whether the given cursor kind represents a<br>
>> declaration.<br>
>> - */<br>
>> -CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind);<br>
>> -<br>
>> -/**<br>
>> - * \brief Determine whether the given cursor kind represents a simple<br>
>> - * reference.<br>
>> + */<br>
>> +CINDEX_LINKAGE unsigned clang_isDeclaration(enum CXCursorKind);<br>
>> +<br>
>> +/**<br>
>> + * \brief Determine whether the given declaration is invalid.<br>
>> + *<br>
>> + * A declaration is invalid if it could not be parsed successfully.<br>
>> + *<br>
>> + * \returns non-zero if the cursor represents a declaration and it is<br>
>> + * invalid, otherwise NULL.<br>
>> + */<br>
>> +CINDEX_LINKAGE unsigned clang_isInvalidDeclaration(CXCursor);<br>
>> +<br>
>> +/**<br>
>> + * \brief Determine whether the given cursor kind represents a simple<br>
>> + * reference.<br>
>> *<br>
>> * Note that other kinds of cursors (such as expressions) can also refer<br>
>> to<br>
>> * other cursors. Use clang_getCursorReferenced() to determine whether a<br>
>><br>
>> Modified: cfe/trunk/test/Index/print-type-size.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/print-type-size.cpp?rev=321697&r1=321696&r2=321697&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/print-type-size.cpp?rev=321697&r1=321696&r2=321697&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/test/Index/print-type-size.cpp (original)<br>
>> +++ cfe/trunk/test/Index/print-type-size.cpp Wed Jan 3 01:49:31 2018<br>
>> @@ -1,14 +1,14 @@<br>
>> // from SemaCXX/class-layout.cpp<br>
>> // RUN: c-index-test -test-print-type-size %s -target x86_64-pc-linux-gnu<br>
>> | FileCheck -check-prefix=CHECK64 %s<br>
>> // RUN: c-index-test -test-print-type-size %s -target i386-apple-darwin9<br>
>> | FileCheck -check-prefix=CHECK32 %s<br>
>> -<br>
>> -namespace basic {<br>
>> -<br>
>> -// CHECK64: VarDecl=v:[[@LINE+2]]:6 (Definition) [type=void]<br>
>> [typekind=Void]<br>
>> -// CHECK32: VarDecl=v:[[@LINE+1]]:6 (Definition) [type=void]<br>
>> [typekind=Void]<br>
>> -void v;<br>
>> -<br>
>> -// CHECK64: VarDecl=v1:[[@LINE+2]]:7 (Definition) [type=void *]<br>
>> [typekind=Pointer] [sizeof=8] [alignof=8]<br>
>> +<br>
>> +namespace basic {<br>
>> +<br>
>> +// CHECK64: VarDecl=v:[[@LINE+2]]:6 (Definition) (invalid) [type=void]<br>
>> [typekind=Void]<br>
>> +// CHECK32: VarDecl=v:[[@LINE+1]]:6 (Definition) (invalid) [type=void]<br>
>> [typekind=Void]<br>
>> +void v;<br>
>> +<br>
>> +// CHECK64: VarDecl=v1:[[@LINE+2]]:7 (Definition) [type=void *]<br>
>> [typekind=Pointer] [sizeof=8] [alignof=8]<br>
>> // CHECK32: VarDecl=v1:[[@LINE+1]]:7 (Definition) [type=void *]<br>
>> [typekind=Pointer] [sizeof=4] [alignof=4]<br>
>> void *v1;<br>
>><br>
>><br>
>> Modified: cfe/trunk/tools/c-index-test/c-index-test.c<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=321697&r1=321696&r2=321697&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=321697&r1=321696&r2=321697&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/tools/c-index-test/c-index-test.c (original)<br>
>> +++ cfe/trunk/tools/c-index-test/c-index-test.c Wed Jan 3 01:49:31 2018<br>
>> @@ -809,12 +809,14 @@ static void PrintCursor(CXCursor Cursor,<br>
>> if (clang_EnumDecl_isScoped(Cursor))<br>
>> printf(" (scoped)");<br>
>> if (clang_Cursor_isVariadic(Cursor))<br>
>> - printf(" (variadic)");<br>
>> - if (clang_Cursor_isObjCOptional(Cursor))<br>
>> - printf(" (@optional)");<br>
>> -<br>
>> - switch (clang_getCursorExceptionSpecificationType(Cursor))<br>
>> - {<br>
>> + printf(" (variadic)");<br>
>> + if (clang_Cursor_isObjCOptional(Cursor))<br>
>> + printf(" (@optional)");<br>
>> + if (clang_isInvalidDeclaration(Cursor))<br>
>> + printf(" (invalid)");<br>
>> +<br>
>> + switch (clang_getCursorExceptionSpecificationType(Cursor))<br>
>> + {<br>
>> case CXCursor_ExceptionSpecificationKind_None:<br>
>> break;<br>
>><br>
>><br>
>> Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=321697&r1=321696&r2=321697&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=321697&r1=321696&r2=321697&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
>> +++ cfe/trunk/tools/libclang/CIndex.cpp Wed Jan 3 01:49:31 2018<br>
>> @@ -5418,12 +5418,21 @@ unsigned clang_isInvalid(enum CXCursorKi<br>
>><br>
>> unsigned clang_isDeclaration(enum CXCursorKind K) {<br>
>> return (K >= CXCursor_FirstDecl && K <= CXCursor_LastDecl) ||<br>
>> - (K >= CXCursor_FirstExtraDecl && K <= CXCursor_LastExtraDecl);<br>
>> -}<br>
>> -<br>
>> -unsigned clang_isReference(enum CXCursorKind K) {<br>
>> - return K >= CXCursor_FirstRef && K <= CXCursor_LastRef;<br>
>> -}<br>
>> + (K >= CXCursor_FirstExtraDecl && K <= CXCursor_LastExtraDecl);<br>
>> +}<br>
>> +<br>
>> +unsigned clang_isInvalidDeclaration(CXCursor C) {<br>
>> + if (clang_isDeclaration(C.kind)) {<br>
>> + if (const Decl *D = getCursorDecl(C))<br>
>> + return D->isInvalidDecl();<br>
>> + }<br>
>> +<br>
>> + return 0;<br>
>> +}<br>
>> +<br>
>> +unsigned clang_isReference(enum CXCursorKind K) {<br>
>> + return K >= CXCursor_FirstRef && K <= CXCursor_LastRef;<br>
>> +}<br>
>><br>
>> unsigned clang_isExpression(enum CXCursorKind K) {<br>
>> return K >= CXCursor_FirstExpr && K <= CXCursor_LastExpr;<br>
>><br>
>> Modified: cfe/trunk/tools/libclang/libclang.exports<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/libclang.exports?rev=321697&r1=321696&r2=321697&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/libclang.exports?rev=321697&r1=321696&r2=321697&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- cfe/trunk/tools/libclang/libclang.exports (original)<br>
>> +++ cfe/trunk/tools/libclang/libclang.exports Wed Jan 3 01:49:31 2018<br>
>> @@ -288,12 +288,13 @@ clang_index_isEntityObjCContainerKind<br>
>> clang_index_setClientContainer<br>
>> clang_index_setClientEntity<br>
>> clang_isAttribute<br>
>> -clang_isConstQualifiedType<br>
>> -clang_isCursorDefinition<br>
>> -clang_isDeclaration<br>
>> -clang_isExpression<br>
>> -clang_isFileMultipleIncludeGuarded<br>
>> -clang_isFunctionTypeVariadic<br>
>> +clang_isConstQualifiedType<br>
>> +clang_isCursorDefinition<br>
>> +clang_isDeclaration<br>
>> +clang_isInvalidDeclaration<br>
>> +clang_isExpression<br>
>> +clang_isFileMultipleIncludeGuarded<br>
>> +clang_isFunctionTypeVariadic<br>
>> clang_isInvalid<br>
>> clang_isPODType<br>
>> clang_isPreprocessing<br>
>><br>
>><br>
>> _______________________________________________<br>
>> cfe-commits mailing list<br>
>> cfe-commits@lists.llvm.org<br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</div>
</span></font></div>
</body>
</html>