ilya-biryukov added a comment.

In, @simark wrote:

> Is there a way to get the macro name from the MacroInfo object?  I couldn't 
> find any, so the solution I'm considering is to make 
> `DeclarationAndMacrosFinder::takeMacroInfos` return an 
> `std::vector<std::pair<StringRef, const MacroInfo *>>`, where the first 
> member of the pair is the macro name.  It would come from 
> `IdentifierInfo->getName()` in `DeclarationAndMacrosFinder::finish`.  Does 
> that make sense, or is there a simpler way?

I don't think there's a way to get macro name from `MacroInfo`. `pair<Name, 
MacroInfo*>` sounds good to me, I'd probably even use a named struct here: 
`struct MacroDecl { StringRef Name; const MacroInfo &Info; }`

  rCTE Clang Tools Extra

cfe-commits mailing list

Reply via email to