[PATCH] D35894: [clangd] Code hover for Clangd
Ilya Biryukov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 13 10:10:18 PST 2018
ilya-biryukov added a comment.
In https://reviews.llvm.org/D35894#1006124, @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; }`
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D35894
More information about the cfe-commits
mailing list