From: Fariborz Jahanian Date: Wed, 11 Feb 2009 22:31:45 +0000 (+0000) Subject: Patch to fix encoding in 64bit abi. With this patch X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=72696e17f90d399448d360cb43aebe5eb2007d4f;p=clang Patch to fix encoding in 64bit abi. With this patch all but one dejagnu encoding tests for darwin pass in nonfragile abi mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64334 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 72aef4269b..1184710041 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -1969,13 +1969,19 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, case BuiltinType::UChar: encoding = 'C'; break; case BuiltinType::UShort: encoding = 'S'; break; case BuiltinType::UInt: encoding = 'I'; break; - case BuiltinType::ULong: encoding = 'L'; break; + case BuiltinType::ULong: + encoding = + (const_cast(this))->getIntWidth(T) == 32 ? 'L' : 'Q'; + break; case BuiltinType::ULongLong: encoding = 'Q'; break; case BuiltinType::Char_S: case BuiltinType::SChar: encoding = 'c'; break; case BuiltinType::Short: encoding = 's'; break; case BuiltinType::Int: encoding = 'i'; break; - case BuiltinType::Long: encoding = 'l'; break; + case BuiltinType::Long: + encoding = + (const_cast(this))->getIntWidth(T) == 32 ? 'l' : 'q'; + break; case BuiltinType::LongLong: encoding = 'q'; break; case BuiltinType::Float: encoding = 'f'; break; case BuiltinType::Double: encoding = 'd'; break;