llvm_unreachable("placeholder types shouldn't get to name mangling");
case BuiltinType::ObjCId:
- Out << "PA";
mangleArtificalTagType(TTK_Struct, "objc_object");
break;
case BuiltinType::ObjCClass:
- Out << "PA";
mangleArtificalTagType(TTK_Struct, "objc_class");
break;
case BuiltinType::ObjCSel:
void MicrosoftCXXNameMangler::mangleType(const ObjCObjectPointerType *T,
Qualifiers Quals, SourceRange Range) {
- if (T->isObjCIdType() || T->isObjCClassType())
- return mangleType(T->getPointeeType(), Range, QMM_Drop);
-
QualType PointeeType = T->getPointeeType();
manglePointerCVQualifiers(Quals);
manglePointerExtQualifiers(Quals, PointeeType);
// CHECK-LABEL: "\01?g@@YAXAAPAUobjc_object@@@Z"
void g(const id &) {}
-// CHECK-LABEL: "\01?g@@YAXABPAUobjc_object@@@Z"
+// CHECK-LABEL: "\01?g@@YAXABQAUobjc_object@@@Z"
void g(id &&) {}
// CHECK-LABEL: "\01?g@@YAX$$QAPAUobjc_object@@@Z"
// CHECK-LABEL: "\01?h@@YAXAAPAUobjc_class@@@Z"
void h(const Class &) {}
-// CHECK-LABEL: "\01?h@@YAXABPAUobjc_class@@@Z"
+// CHECK-LABEL: "\01?h@@YAXABQAUobjc_class@@@Z"
void h(Class &&) {}
// CHECK-LABEL: "\01?h@@YAX$$QAPAUobjc_class@@@Z"
const I &l() { return *kI; }
// CHECK-LABEL: "\01?l@@YAABUI@@XZ"
+void m(const id) {}
+// CHECK-LABEL: "\01?m@@YAXQAUobjc_object@@@Z"
+
+void m(const I *) {}
+// CHECK-LABEL: "\01?m@@YAXPBUI@@@Z"
+
struct __declspec(dllexport) s {
struct s &operator=(const struct s &) = delete;
// CHECK-LABEL: "\01?m@s@@QAAX$$QAPAUobjc_object@@@Z"
void m(const id &) {}
- // CHECK-LABEL: "\01?m@s@@QAAXABPAUobjc_object@@@Z"
+ // CHECK-LABEL: "\01?m@s@@QAAXABQAUobjc_object@@@Z"
void m(const id &&) {}
- // CHECK-LABEL: "\01?m@s@@QAAX$$QBPAUobjc_object@@@Z"
+ // CHECK-LABEL: "\01?m@s@@QAAX$$QBQAUobjc_object@@@Z"
void m(Class *) {}
// CHECK-LABEL: "\01?m@s@@QAAXPAPAUobjc_class@@@Z"
void m(const Class *) {}
- // CHECK-LABEL: "\01?m@s@@QAAXPBPAUobjc_class@@@Z"
+ // CHECK-LABEL: "\01?m@s@@QAAXPBQAUobjc_class@@@Z"
void m(Class) {}
// CHECK-LABEL: "\01?m@s@@QAAXPAUobjc_class@@@Z"
// CHECK-LABEL: "\01?m@s@@QAAXAAPAUobjc_class@@@Z"
void m(const Class &) {}
- // CHECK-LABEL: "\01?m@s@@QAAXABPAUobjc_class@@@Z"
+ // CHECK-LABEL: "\01?m@s@@QAAXABQAUobjc_class@@@Z"
void m(Class &&) {}
// CHECK-LABEL: "\01?m@s@@QAAX$$QAPAUobjc_class@@@Z"
void m(const Class &&) {}
- // CHECK-LABEL: "\01?m@s@@QAAX$$QBPAUobjc_class@@@Z"
+ // CHECK-LABEL: "\01?m@s@@QAAX$$QBQAUobjc_class@@@Z"
+};
+
+template <typename T>
+struct remove_pointer { typedef T type; };
+
+template <typename T>
+struct remove_pointer<T *> {
+ typedef T type;
};
+template <typename T>
+struct t {
+ t() {}
+};
+
+template struct t<id>;
+// CHECK-LABEL: "\01??0?$t@PAUobjc_object@@@@QAA@XZ"
+
+template struct t<remove_pointer<id>::type>;
+// CHECK-LABEL: "\01??0?$t@Uobjc_object@@@@QAA@XZ"
+