[cfe-commits] r135304 - /cfe/trunk/include/clang/AST/DeclObjC.h
Argyrios Kyrtzidis
kyrtzidis at apple.com
Fri Jul 15 15:04:00 PDT 2011
On Jul 15, 2011, at 2:49 PM, Douglas Gregor wrote:
>
> On Jul 15, 2011, at 2:39 PM, Argyrios Kyrtzidis wrote:
>
>> Author: akirtzidis
>> Date: Fri Jul 15 16:39:32 2011
>> New Revision: 135304
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=135304&view=rev
>> Log:
>> The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.
>>
>> Modified:
>> cfe/trunk/include/clang/AST/DeclObjC.h
>>
>> Modified: cfe/trunk/include/clang/AST/DeclObjC.h
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclObjC.h?rev=135304&r1=135303&r2=135304&view=diff
>> ==============================================================================
>> --- cfe/trunk/include/clang/AST/DeclObjC.h (original)
>> +++ cfe/trunk/include/clang/AST/DeclObjC.h Fri Jul 15 16:39:32 2011
>> @@ -1122,6 +1122,12 @@
>> ClassInterface(classInterface) {}
>>
>> public:
>> + virtual Decl *getCanonicalDecl() {
>> + if (Decl *interface = getClassInterface())
>> + return interface;
>> + return this;
>> + }
>> +
>
> I think this change should be limited to libclang's clang_getCanonicalCursor(). Sema and AST are almost certainly not ready for getCanonicalCursor() to change the kind of declaration node except in the *very* limited cases corresponding to using declarations.
How does it affect negatively Sema and AST, could you give an example ?
>
> - Doug
>
More information about the cfe-commits
mailing list