]> granicus.if.org Git - clang/commitdiff
Last @encode'ing fix for objc2's nonfragile abi.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 11 Feb 2009 23:59:18 +0000 (23:59 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 11 Feb 2009 23:59:18 +0000 (23:59 +0000)
All relevant dejagnu enocding tests pass in this mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64341 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index 11847100410d6ac4abeac4d3c3ea5c21f6c58d7d..46b88df153a9c345fff06ac323712701970e2ec5 100644 (file)
@@ -1915,15 +1915,18 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD,
 
 /// getLegacyIntegralTypeEncoding -
 /// Another legacy compatibility encoding: 32-bit longs are encoded as 
-/// 'l' or 'L', but not always.  For typedefs, we need to use 
+/// 'l' or 'L' , but not always.  For typedefs, we need to use 
 /// 'i' or 'I' instead if encoding a struct field, or a pointer!
 ///
 void ASTContext::getLegacyIntegralTypeEncoding (QualType &PointeeTy) const {
   if (dyn_cast<TypedefType>(PointeeTy.getTypePtr())) {
     if (const BuiltinType *BT = PointeeTy->getAsBuiltinType()) {
-      if (BT->getKind() == BuiltinType::ULong)
+      if (BT->getKind() == BuiltinType::ULong &&
+          ((const_cast<ASTContext *>(this))->getIntWidth(PointeeTy) == 32))
         PointeeTy = UnsignedIntTy;
-        else if (BT->getKind() == BuiltinType::Long)
+      else 
+        if (BT->getKind() == BuiltinType::Long &&
+            ((const_cast<ASTContext *>(this))->getIntWidth(PointeeTy) == 32))
           PointeeTy = IntTy;
     }
   }