[PATCH] D141714: Fix ast print of variables with attributes

Giuliano Belinassi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 24 09:18:38 PST 2023


giulianobelinassi added a comment.



> The way Clang handles this is to mostly go back to the original source code (through the source manager and source location information) to grab what the user actually wrote. The pretty printing functionality loses information like whether something was expanded from a macro, etc and so, if the goal is to show what the user wrote, it's likely to be a really big uphill battle to get that through the pretty printer.

This is something I already do, but there are some cases where I simply can not track down the origin of the declaration (some very complex macro expansions) and in this case I simply fall back to the prettyprinter. Those are the cases where I am interesting in fixing the prettyprinter. It is also worth noting that I am currently interested in C code so perhaps most of these issues don't manifest in this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141714/new/

https://reviews.llvm.org/D141714



More information about the cfe-commits mailing list