simark added a comment. > I'm not aware of the code that pretty-prints macros. There's a code that > dumps debug output, but it's not gonna help in that case. > Alternatively, we could simply print the macro name and not print the > definition. That's super-simple and is in line with hovers for the AST decls. > Let's do that in the initial version.
Ok, I'm considering printing "#define MACRO". Just printing the name would not be very useful, at least printing "#define" gives the information that the hovered entity is defined as a macro (and not a function or variable). 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? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D35894 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits