[cfe-dev] Determining if ObjCIvarDecl is in multi-declaration

Chris Lattner clattner at apple.com
Wed Apr 23 23:04:52 PDT 2008


On Apr 23, 2008, at 10:56 PM, Chris Lattner wrote:
>> I'm removing an instance variable.  In the current code, if it's a  
>> multi-decl, I just give up, which is what spawned this question.   
>> Ideally, I'd like to be able to remove an inst var from a multi- 
>> decl as easily as from a single decl.
>>
>
> Okay, so you need more information, or some amount of fuzziness to  
> do this.  Specifically, if you have:
>
>
> int *X, ***Y[10];
>
> Even if you know that X/Y are multi-declaration, you'll have to have  
> some way of handling the *'s and the array suffix.  Because types  
> are unique'd, they don't have location information.  Handling this  
> sort of thing will require some amount of fuzzy editting: could  
> fuzzy editting be used to scan for the comma also?

Incidentally, you can also reuse the Lexer to do this for you (relex  
the tokens), so you don't have to use strchr on the input buffer.  If  
you do however, you can get a char* for a SourceLocation with  
SourceManager::getCharacterData(SourceLocation Loc)

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080423/358dcbe2/attachment.html>


More information about the cfe-dev mailing list