From: Daniel Dunbar Date: Fri, 26 Jun 2009 18:32:06 +0000 (+0000) Subject: Simplify, and fix a possible crash (never happens however, because we don't ever X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0183e8281b2ddacdca87cd2f749255d06a4bfe6;p=clang Simplify, and fix a possible crash (never happens however, because we don't ever take this path with non-builtin floating point types). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74303 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 325b2ccaa2..865e8c240b 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -5014,16 +5014,13 @@ CodeGen::RValue CGObjCNonFragileABIMac::EmitMessageSend( } } else if (!IsSuper && ResultType->isFloatingType()) { - if (const BuiltinType *BT = ResultType->getAsBuiltinType()) { - BuiltinType::Kind k = BT->getKind(); - if (k == BuiltinType::LongDouble) { - Fn = ObjCTypes.getMessageSendFpretFixupFn(); - Name += "objc_msgSend_fpret_fixup"; - } - else { - Fn = ObjCTypes.getMessageSendFixupFn(); - Name += "objc_msgSend_fixup"; - } + if (ResultType->isSpecificBuiltinType(BuiltinType::LongDouble)) { + Fn = ObjCTypes.getMessageSendFpretFixupFn(); + Name += "objc_msgSend_fpret_fixup"; + } + else { + Fn = ObjCTypes.getMessageSendFixupFn(); + Name += "objc_msgSend_fixup"; } } else {