[cfe-dev] How to print(or dump) a function with qualified name

wolf5x wolf5x1016 at gmail.com
Thu Oct 25 02:26:15 PDT 2012


Hi all,

 

1.       I'm doing some src-to-src transformation and now want to print a
function decl. But the Decl::print() or Decl::dump() don't print qualifiers.


For example, a method defined outside the class :

         int ClassName::Method() {}

is printed as 

         int Method(){}

How can I print it with "ClassName::" ?

I know getQualifiedNameAsString() can get the full name, but I need to add
other trivial things like return type, parmvars, template info all by
myself, not a good plan.

 

2.       Another minor case, the ConditionVariableDeclStmt of a condition
expression is not printed correctly, eg.

if(T t=x) {}

is printed as 

if(t) {}

Maybe it needs a tiny patch.

 

I'm using clang 3.1 release.

 

Thank you.

 

 

Best Regards,

wolf5x(Qingquan Zhang)

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121025/f96955d5/attachment.html>


More information about the cfe-dev mailing list