[cfe-dev] A patch for printing policy and other stuff

Chris Lattner clattner at apple.com
Tue Jun 30 09:17:52 PDT 2009


On Jun 30, 2009, at 5:01 AM, Olaf Krzikalla wrote:

> Hi @clang,
>
> I've created a patch for some of the issues discussed earlier in "A  
> bunch of more or less related issues" and some other things:
> Into the details:
>
> 1. In ParentMap I added a function "addStmt" which actually adds a  
> Statement or updates the parent relations of an already existing  
> statement. Due to the second functionality I'm rather unsure with  
> the name but updateStmt sounds not right too as it conceals the add  
> part.
> 2. In  PrinterHelper::handledStmt I introduced the IndentLevel. This  
> can be useful if someone (e.g. me) want to print something before a  
> particular statement (e.g. a comment) properly formatted. This  
> affected AST/CFG.cpp.
> 3. PrintingPolicy gets a new property IndentStyle. At the moment  
> this property is only evaluated in StmtPrinter.
> 4. A harmless but useful typedef in StmtVisitor.

Seems pretty reasonable.  Some syntactic issues: please keep code in  
80 columns, and please end sentences in a comment with a period.   
Also, is there some way that you can expose the new printing style  
through to the command line?

-Chris 



More information about the cfe-dev mailing list