On Fri, Mar 8, 2013 at 3:57 AM, jahanian <[email protected]> wrote:
>
> On Mar 7, 2013, at 3:51 PM, Dmitri Gribenko <[email protected]> wrote:
>
>> Hi Fariborz,
>>
>> On Fri, Mar 8, 2013 at 1:33 AM, Fariborz Jahanian <[email protected]>
>> wrote:
>>> + /// \brief True if block command is a container API; such as @interface.
>>> + unsigned IsContainerDeclarationCommand : 1;
>>
>> Is the 'container' the best term for this? I don't know ObjC, but a
>> container is something like std::vector for me.
>
> It is not only ObjC objects but also class/struct/union objects. So, I
> probably
> should use something like IsObjectDeclarationCommand?
I'd prefer IsRecordLikeDeclarationCommand. Clang already uses the
term 'record' to describe struct, class and union.
>>> +void Sema::checkContainerDeclVerbatimLine(const BlockCommandComment
>>> *Comment) {
>>> + const CommandInfo *Info = Traits.getCommandInfo(Comment->getCommandID());
>>> + if (!Info->IsContainerDeclarationCommand)
>>> + return;
>>> + StringRef Name = Info->Name;
>>> + unsigned DiagSelect = llvm::StringSwitch<unsigned>(Name)
>>> + .Case("class", !isClassStructDecl() ? 1 : 0)
>>> + .Case("interface", !isObjCInterfaceDecl() ? 2 : 0)
>>> + .Case("protocol", !isObjCProtocolDecl() ? 3 : 0)
>>> + .Case("struct", !isClassStructDecl() ? 4 : 0)
>>> + .Case("union", !isUnionDecl() ? 5 : 0)
>>> + .Default(0);
>>
>> Please don't StringSwitch on the command name. Statically known
>> commands have IDs. See
>> CommentASTToXMLConverter::visitBlockCommandComment for an example of
>> how to use these.
>
> Comment->getCommandID() returns the static ID number. But I also
> need to know the static ID number for "interface", etc. to compare them
> against.
> How do I get the static IDs for the commands I am interested in?
It is CommandTraits::KCI_<command name>, for example
CommandTraits::KCI_interface.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits