[cfe-commits] [PATCH] Addition of color to -ast-dump
Richard Smith
richard at metafoo.co.uk
Fri Jan 11 16:31:12 PST 2013
================
Comment at: lib/AST/ASTDumper.cpp:36-76
@@ +35,43 @@
+ // Decl kind names (VarDecl, FunctionDecl, etc)
+ static const raw_ostream::Colors declKindNameColor = raw_ostream::GREEN;
+ static const bool declKindNameBold = true;
+ // Attr names (CleanupAttr, GuardedByAttr, etc)
+ static const raw_ostream::Colors attrColor = raw_ostream::BLUE;
+ static const bool attrBold = true;
+ // Statement names (DeclStmt, ImplicitCastExpr, etc)
+ static const raw_ostream::Colors stmtColor = raw_ostream::MAGENTA;
+ static const bool stmtBold = true;
+
+ // Type names (int, float, etc, plus user defined types)
+ static const raw_ostream::Colors typeColor = raw_ostream::GREEN;
+ static const bool typeBold = false;
+
+ // Pointer address
+ static const raw_ostream::Colors addressColor = raw_ostream::YELLOW;
+ static const bool addressBold = false;
+ // Source locations
+ static const raw_ostream::Colors locationColor = raw_ostream::YELLOW;
+ static const bool locationBold = true;
+
+ // lvalue/xvalue
+ static const raw_ostream::Colors valueKindColor = raw_ostream::CYAN;
+ static const bool valueKindBold = false;
+ // bitfield/objcproperty/objcsubscript/vectorcomponent
+ static const raw_ostream::Colors objectKindColor = raw_ostream::CYAN;
+ static const bool objectKindBold = false;
+
+ // Null statements
+ static const raw_ostream::Colors nullColor = raw_ostream::BLUE;
+ static const bool nullBold = false;
+
+ // CastKind from CastExpr's
+ static const raw_ostream::Colors castColor = raw_ostream::RED;
+ static const bool castBold = false;
+
+ // Value of the statement
+ static const raw_ostream::Colors valueColor = raw_ostream::CYAN;
+ static const bool valueBold = true;
+ // Decl names
+ static const raw_ostream::Colors declNameColor = raw_ostream::CYAN;
+ static const bool declNameBold = true;
+
----------------
These names should all have a leading capital letter.
Maybe add a struct wrapping a Colors value and a Bold flag?
http://llvm-reviews.chandlerc.com/D291
More information about the cfe-commits
mailing list