Context.mangleObjCMethodName(MD, Out);
}
+static bool isTypeSubstitutable(Qualifiers Quals, const Type *Ty) {
+ if (Quals)
+ return true;
+ if (Ty->isSpecificBuiltinType(BuiltinType::ObjCSel))
+ return true;
+ if (Ty->isOpenCLSpecificType())
+ return true;
+ if (Ty->isBuiltinType())
+ return false;
+
+ return true;
+}
+
void CXXNameMangler::mangleType(QualType T) {
// If our type is instantiation-dependent but not dependent, we mangle
// it as it was written in the source, removing any top-level sugar.
Qualifiers quals = split.Quals;
const Type *ty = split.Ty;
- bool isSubstitutable = quals || !isa<BuiltinType>(T);
+ bool isSubstitutable = isTypeSubstitutable(quals, ty);
if (isSubstitutable && mangleSubstitution(T))
return;
--- /dev/null
+// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+
+// CHECK: @_Z4bad1P8NSObjectP13objc_selectorP11objc_objectS4_
+void bad1(struct NSObject *, SEL, id, id) {}
fnc4smp(glb_smp);
// CHECK: call void @fnc4smp(i32
}
+
+void __attribute__((overloadable)) bad1(image1d_t *b, image2d_t *c, image2d_t *d) {}
+// CHECK-LABEL: @_Z4bad1P11ocl_image1dP11ocl_image2dS2_