aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/TypePrinter.cpp
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo.bagnara@gmail.com>2010-06-16 14:59:30 +0000
committerAbramo Bagnara <abramo.bagnara@gmail.com>2010-06-16 14:59:30 +0000
commit6cd8087e66d706f2317865f86c865fd9bc6969c9 (patch)
treede1781c31ba2111c10c422dfe55ecad08886c42d /lib/AST/TypePrinter.cpp
parent50163009b13386d21c80e38759db2b4818cde7b0 (diff)
Added TemplateTypeParmType::getDecl().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106099 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypePrinter.cpp')
-rw-r--r--lib/AST/TypePrinter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp
index 2fa84f350b..b3e2a442b2 100644
--- a/lib/AST/TypePrinter.cpp
+++ b/lib/AST/TypePrinter.cpp
@@ -506,12 +506,12 @@ void TypePrinter::PrintTemplateTypeParm(const TemplateTypeParmType *T,
std::string &S) {
if (!S.empty()) // Prefix the basic type, e.g. 'parmname X'.
S = ' ' + S;
-
- if (!T->getName())
+
+ if (IdentifierInfo *Id = T->getDecl() ? T->getDecl()->getIdentifier() : 0)
+ S = Id->getName().str() + S;
+ else
S = "type-parameter-" + llvm::utostr_32(T->getDepth()) + '-' +
llvm::utostr_32(T->getIndex()) + S;
- else
- S = T->getName()->getName().str() + S;
}
void TypePrinter::PrintSubstTemplateTypeParm(const SubstTemplateTypeParmType *T,