diff options
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 6aa3c8eb38..303fc7e7ca 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -443,6 +443,11 @@ const ObjCQualifiedIdType *Type::getAsObjCQualifiedIdType() const { return dyn_cast<ObjCQualifiedIdType>(CanonicalType); } +const TemplateTypeParmType *Type::getAsTemplateTypeParmType() const { + // There is no sugar for template type parameters, so just return + // the canonical type pointer if it is the right class. + return dyn_cast<TemplateTypeParmType>(CanonicalType); +} bool Type::isIntegerType() const { if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) @@ -1002,6 +1007,12 @@ void TypedefType::getAsStringInternal(std::string &InnerString) const { InnerString = getDecl()->getIdentifier()->getName() + InnerString; } +void TemplateTypeParmType::getAsStringInternal(std::string &InnerString) const { + if (!InnerString.empty()) // Prefix the basic type, e.g. 'parmname X'. + InnerString = ' ' + InnerString; + InnerString = getDecl()->getIdentifier()->getName() + InnerString; +} + void ObjCInterfaceType::getAsStringInternal(std::string &InnerString) const { if (!InnerString.empty()) // Prefix the basic type, e.g. 'typedefname X'. InnerString = ' ' + InnerString; |