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

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 24 10:12:39 PST 2023


aaron.ballman added a comment.

In D141714#4077631 <https://reviews.llvm.org/D141714#4077631>, @giulianobelinassi wrote:

>> 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.

Ah, good to know; that should hopefully make it easier for you.


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