[cfe-commits] r41303 - in /cfe/trunk: Parse/ParseDecl.cpp Parse/ParseObjc.cpp include/clang/Parse/Parser.h
Chris Lattner
clattner at apple.com
Mon Aug 27 21:35:50 PDT 2007
On Aug 27, 2007, at 9:16 PM, Steve Naroff wrote:
>
> On Aug 27, 2007, at 9:06 PM, Chris Lattner wrote:
>
>> +/// objc-type-qualifier: one of
>>> +/// in out inout bycopy byref oneway
>>> +///
>>> +/// FIXME: remove the string compares...
>>> +bool Parser::isObjCTypeQualifier() {
>>> + if (Tok.getKind() == tok::identifier) {
>>> + const char *qual = Tok.getIdentifierInfo()->getName();
>>> + return (strcmp(qual, "in") == 0) || (strcmp(qual, "out") ==
>>> 0) ||
>>> + (strcmp(qual, "inout") == 0) || (strcmp(qual,
>>> "oneway") == 0) ||
>>> + (strcmp(qual, "bycopy") == 0) || (strcmp(qual,
>>> "byref") == 0);
>>> + }
>>
>> Ouch :)
>>
>
> Understood. This is temporary (hence the FIXME above).
>
> The solution you outline below sounds fine with me...
Sounds good. The other way to do it would be to add yet-another
bitfield to IdentifierInfo to hold these, similar to PPKeywordKind/
ObjCKeywordKind etc, but this is fairly special purpose, so using a
small table is probably better. *shrug*
-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20070827/75c110bb/attachment.html>
More information about the cfe-commits
mailing list