diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-11 23:59:18 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-11 23:59:18 +0000 |
commit | 77b6b5d6d8ff5b1a7eed45794d8dd507db311ed3 (patch) | |
tree | dfbf43fda1de3d509902c99a8f0738f63e00dcae /clang/lib/AST/ASTContext.cpp | |
parent | 6f6abfd94baa8420a9d53c86c282c37175401f35 (diff) | |
download | bcm5719-llvm-77b6b5d6d8ff5b1a7eed45794d8dd507db311ed3.tar.gz bcm5719-llvm-77b6b5d6d8ff5b1a7eed45794d8dd507db311ed3.zip |
Last @encode'ing fix for objc2's nonfragile abi.
All relevant dejagnu enocding tests pass in this mode.
llvm-svn: 64341
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 11847100410..46b88df153a 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -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; } } |