Include id2ast pointers when dumping AST
authorClifford Wolf <clifford@clifford.at>
Wed, 5 Mar 2014 18:56:31 +0000 (19:56 +0100)
committerClifford Wolf <clifford@clifford.at>
Wed, 5 Mar 2014 18:56:31 +0000 (19:56 +0100)
frontends/ast/ast.cc

index d9ad6d8ef7e6b5a84b56117f1580ea4faa00e534..f2f2d0e69fe466e146ead3986fc1d5bf5ca20866 100644 (file)
@@ -244,6 +244,12 @@ void AstNode::dumpAst(FILE *f, std::string indent)
 
        std::string type_name = type2str(type);
        fprintf(f, "%s%s <%s:%d>", indent.c_str(), type_name.c_str(), filename.c_str(), linenum);
+
+       if (id2ast)
+               fprintf(f, " [%p -> %p]", this, id2ast);
+       else
+               fprintf(f, " [%p]", this);
+
        if (!str.empty())
                fprintf(f, " str='%s'", str.c_str());
        if (!bits.empty()) {