diff options
author | Chris Lattner <sabre@nondot.org> | 2008-07-27 00:48:22 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-07-27 00:48:22 +0000 |
commit | 872eb55f5e4bd11a8263c5d27c14b45ed0d2f86c (patch) | |
tree | eede5288af79de7f07820d17062a51c214129488 /clang/lib | |
parent | e80159da05f33afda83857c61515957baa4c15a4 (diff) | |
download | bcm5719-llvm-872eb55f5e4bd11a8263c5d27c14b45ed0d2f86c.tar.gz bcm5719-llvm-872eb55f5e4bd11a8263c5d27c14b45ed0d2f86c.zip |
make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.
llvm-svn: 54116
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/Type.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index d5bef07ca96..d32f963acb1 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -810,6 +810,17 @@ void QualType::dump(const char *msg) const { else fprintf(stderr, "%s\n", R.c_str()); } +void QualType::dump() const { + dump(""); +} + +void Type::dump() const { + std::string S = "identifier"; + getAsStringInternal(S); + fprintf(stderr, "%s\n", S.c_str()); +} + + static void AppendTypeQualList(std::string &S, unsigned TypeQuals) { // Note: funkiness to ensure we get a space only between quals. diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 37e4ec715bd..56632d1d772 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2052,6 +2052,7 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) { } else assert(0 && "Unknown/unexpected decl type"); } + // If the operand has type "type", the result has type "pointer to type". return Context.getPointerType(op->getType()); } |