void VisitTemplateName(TemplateName Name);
void VisitTemplateArgument(const TemplateArgument &Arg);
+ void VisitMSGuidDecl(const MSGuidDecl *D);
+
/// Emit a Decl's name using NamedDecl::printName() and return true if
/// the decl had no name.
bool EmitDeclName(const NamedDecl *D);
}
if (const BuiltinType *BT = T->getAs<BuiltinType>()) {
- unsigned char c = '\0';
switch (BT->getKind()) {
case BuiltinType::Void:
- c = 'v'; break;
+ Out << 'v'; break;
case BuiltinType::Bool:
- c = 'b'; break;
+ Out << 'b'; break;
case BuiltinType::UChar:
- c = 'c'; break;
+ Out << 'c'; break;
case BuiltinType::Char8:
- c = 'u'; break; // FIXME: Check this doesn't collide
+ Out << 'u'; break;
case BuiltinType::Char16:
- c = 'q'; break;
+ Out << 'q'; break;
case BuiltinType::Char32:
- c = 'w'; break;
+ Out << 'w'; break;
case BuiltinType::UShort:
- c = 's'; break;
+ Out << 's'; break;
case BuiltinType::UInt:
- c = 'i'; break;
+ Out << 'i'; break;
case BuiltinType::ULong:
- c = 'l'; break;
+ Out << 'l'; break;
case BuiltinType::ULongLong:
- c = 'k'; break;
+ Out << 'k'; break;
case BuiltinType::UInt128:
- c = 'j'; break;
+ Out << 'j'; break;
case BuiltinType::Char_U:
case BuiltinType::Char_S:
- c = 'C'; break;
+ Out << 'C'; break;
case BuiltinType::SChar:
- c = 'r'; break;
+ Out << 'r'; break;
case BuiltinType::WChar_S:
case BuiltinType::WChar_U:
- c = 'W'; break;
+ Out << 'W'; break;
case BuiltinType::Short:
- c = 'S'; break;
+ Out << 'S'; break;
case BuiltinType::Int:
- c = 'I'; break;
+ Out << 'I'; break;
case BuiltinType::Long:
- c = 'L'; break;
+ Out << 'L'; break;
case BuiltinType::LongLong:
- c = 'K'; break;
+ Out << 'K'; break;
case BuiltinType::Int128:
- c = 'J'; break;
+ Out << 'J'; break;
case BuiltinType::Float16:
case BuiltinType::Half:
- c = 'h'; break;
+ Out << 'h'; break;
case BuiltinType::Float:
- c = 'f'; break;
+ Out << 'f'; break;
case BuiltinType::Double:
- c = 'd'; break;
- case BuiltinType::Ibm128: // FIXME: Need separate tag
+ Out << 'd'; break;
case BuiltinType::LongDouble:
- c = 'D'; break;
+ Out << 'D'; break;
case BuiltinType::Float128:
- c = 'Q'; break;
+ Out << 'Q'; break;
case BuiltinType::NullPtr:
- c = 'n'; break;
-#define BUILTIN_TYPE(Id, SingletonId)
-#define PLACEHOLDER_TYPE(Id, SingletonId) case BuiltinType::Id:
-#include "clang/AST/BuiltinTypes.def"
- case BuiltinType::Dependent:
+ Out << 'n'; break;
#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \
- case BuiltinType::Id:
+ case BuiltinType::Id: \
+ Out << "@BT@" << #Suffix << "_" << #ImgType; break;
#include "clang/Basic/OpenCLImageTypes.def"
#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \
- case BuiltinType::Id:
+ case BuiltinType::Id: \
+ Out << "@BT@" << #ExtType; break;
#include "clang/Basic/OpenCLExtensionTypes.def"
case BuiltinType::OCLEvent:
+ Out << "@BT@OCLEvent"; break;
case BuiltinType::OCLClkEvent:
+ Out << "@BT@OCLClkEvent"; break;
case BuiltinType::OCLQueue:
+ Out << "@BT@OCLQueue"; break;
case BuiltinType::OCLReserveID:
+ Out << "@BT@OCLReserveID"; break;
case BuiltinType::OCLSampler:
+ Out << "@BT@OCLSampler"; break;
#define SVE_TYPE(Name, Id, SingletonId) \
- case BuiltinType::Id:
+ case BuiltinType::Id: \
+ Out << "@BT@" << Name; break;
#include "clang/Basic/AArch64SVEACLETypes.def"
#define PPC_VECTOR_TYPE(Name, Id, Size) \
- case BuiltinType::Id:
+ case BuiltinType::Id: \
+ Out << "@BT@" << #Name; break;
#include "clang/Basic/PPCTypes.def"
-#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id:
+#define RVV_TYPE(Name, Id, SingletonId) \
+ case BuiltinType::Id: \
+ Out << "@BT@" << Name; break;
#include "clang/Basic/RISCVVTypes.def"
case BuiltinType::ShortAccum:
+ Out << "@BT@ShortAccum"; break;
case BuiltinType::Accum:
+ Out << "@BT@Accum"; break;
case BuiltinType::LongAccum:
+ Out << "@BT@LongAccum"; break;
case BuiltinType::UShortAccum:
+ Out << "@BT@UShortAccum"; break;
case BuiltinType::UAccum:
+ Out << "@BT@UAccum"; break;
case BuiltinType::ULongAccum:
+ Out << "@BT@ULongAccum"; break;
case BuiltinType::ShortFract:
+ Out << "@BT@ShortFract"; break;
case BuiltinType::Fract:
+ Out << "@BT@Fract"; break;
case BuiltinType::LongFract:
+ Out << "@BT@LongFract"; break;
case BuiltinType::UShortFract:
+ Out << "@BT@UShortFract"; break;
case BuiltinType::UFract:
+ Out << "@BT@UFract"; break;
case BuiltinType::ULongFract:
+ Out << "@BT@ULongFract"; break;
case BuiltinType::SatShortAccum:
+ Out << "@BT@SatShortAccum"; break;
case BuiltinType::SatAccum:
+ Out << "@BT@SatAccum"; break;
case BuiltinType::SatLongAccum:
+ Out << "@BT@SatLongAccum"; break;
case BuiltinType::SatUShortAccum:
+ Out << "@BT@SatUShortAccum"; break;
case BuiltinType::SatUAccum:
+ Out << "@BT@SatUAccum"; break;
case BuiltinType::SatULongAccum:
+ Out << "@BT@SatULongAccum"; break;
case BuiltinType::SatShortFract:
+ Out << "@BT@SatShortFract"; break;
case BuiltinType::SatFract:
+ Out << "@BT@SatFract"; break;
case BuiltinType::SatLongFract:
+ Out << "@BT@SatLongFract"; break;
case BuiltinType::SatUShortFract:
+ Out << "@BT@SatUShortFract"; break;
case BuiltinType::SatUFract:
+ Out << "@BT@SatUFract"; break;
case BuiltinType::SatULongFract:
+ Out << "@BT@SatULongFract"; break;
case BuiltinType::BFloat16:
- IgnoreResults = true;
- return;
+ Out << "@BT@__bf16"; break;
+ case BuiltinType::Ibm128:
+ Out << "@BT@__ibm128"; break;
case BuiltinType::ObjCId:
- c = 'o'; break;
+ Out << 'o'; break;
case BuiltinType::ObjCClass:
- c = 'O'; break;
+ Out << 'O'; break;
case BuiltinType::ObjCSel:
- c = 'e'; break;
+ Out << 'e'; break;
+#define BUILTIN_TYPE(Id, SingletonId)
+#define PLACEHOLDER_TYPE(Id, SingletonId) case BuiltinType::Id:
+#include "clang/AST/BuiltinTypes.def"
+ case BuiltinType::Dependent:
+ // If you're adding a new builtin type, please add its name prefixed
+ // with "@BT@" to `Out` (see cases above).
+ IgnoreResults = true;
+ break;
}
- Out << c;
return;
}
EmitDeclName(D);
}
+void USRGenerator::VisitMSGuidDecl(const MSGuidDecl *D) {
+ VisitDeclContext(D->getDeclContext());
+ Out << "@MG@";
+ D->NamedDecl::printName(Out);
+}
+
//===----------------------------------------------------------------------===//
// USR generation functions.
//===----------------------------------------------------------------------===//