[PATCH] Add debug method to visualize complex source locations

Richard Smith richard at metafoo.co.uk
Mon Jun 3 13:47:25 PDT 2013



================
Comment at: lib/Basic/SourceLocation.cpp:102-104
@@ +101,5 @@
+    } else {
+      OS << IndentStr << "|-"
+         << "Expansion      " << ExpansionLoc.first.printTreeToString(
+                                     SM, PrintCode, IndentStr + "| ") << ",\n";
+    }
----------------
Maybe MacroArg instead of Expansion here. It's confusing to give these two fundamentally different kinds of expansion similar names.

For ExpansionStart/ExpansionEnd, it would be useful to indicate the name of the macro being expanded, and for MacroArg it would be useful to indicate the name of the argument being expanded. (For MacroArg it'd also be nice to indicate the name of the macro whose argument it is, but that's harder to recover.)

It would also be nice for the dump to include the FileIDs.


http://llvm-reviews.chandlerc.com/D768



More information about the cfe-commits mailing list