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 | c36d405a02fab41f6c45cb2bc750d64949742903 (patch) | |
tree | 4b413e13b84dffe504ca596993270a6aea805a9c /lib | |
parent | 4243a94b43ef6207938f3023dfcfb804dd545363 (diff) |
make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Type.cpp | 11 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index d5bef07ca9..d32f963acb 100644 --- a/lib/AST/Type.cpp +++ b/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/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 37e4ec715b..56632d1d77 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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()); } |