aboutsummaryrefslogtreecommitdiff
path: root/AST/Type.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-08 22:51:59 +0000
committerChris Lattner <sabre@nondot.org>2007-08-08 22:51:59 +0000
commit6000dace22f110d8768476989313e9d981d690d0 (patch)
tree9b21e327366209ef05097521b7a4cf2381313511 /AST/Type.cpp
parent13b7c5ff42d6077a8d59e2c9ec9e7fedd0150ae6 (diff)
add a new AST dumper interface (E->dump()). This dumps out
the AST in a structural, non-pretty, form useful for understanding the AST. It isn't quite done yet, but is already somewhat useful. For this example: int test(short X, long long Y) { return X < ((100)); } we get (with -parse-ast-dump): int test(short X, long long Y) (CompoundStmt 0x2905ce0 (ReturnStmt 0x2905cd0 (BinaryOperator 0x2905cb0 '<' (ImplicitCastExpr 0x2905ca0 (DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0)) (ParenExpr 0x2905c80 (ParenExpr 0x2905c60 (IntegerLiteral 0x2905c40 100)))))) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'AST/Type.cpp')
-rw-r--r--AST/Type.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/AST/Type.cpp b/AST/Type.cpp
index 27453ca981..dca9404dc9 100644
--- a/AST/Type.cpp
+++ b/AST/Type.cpp
@@ -677,7 +677,7 @@ void TypeOfExpr::getAsStringInternal(std::string &InnerString) const {
if (!InnerString.empty()) // Prefix the basic type, e.g. 'typeof(e) X'.
InnerString = ' ' + InnerString;
std::ostringstream s;
- getUnderlyingExpr()->print(s);
+ getUnderlyingExpr()->printPretty(s);
InnerString = "typeof(" + s.str() + ")" + InnerString;
}