aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-13 23:45:47 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-13 23:45:47 +0000
commitaa1d76163e4b0b1cc54e222be67379f8c02e8ffa (patch)
tree36168b60cacec52414dc9c45e371a35bad992015 /lib
parent709210feee317b8d6690dd1d15c2b74cfe55e261 (diff)
Add encoding of reference types like gcc does for objc methods and
blocks. Fixes PR6468. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/ASTContext.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 1fa17f0b4b..68620dc346 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -3494,13 +3494,18 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
return;
}
+ // encoding for pointer or r3eference types.
+ QualType PointeeTy;
if (const PointerType *PT = T->getAs<PointerType>()) {
if (PT->isObjCSelType()) {
S += ':';
return;
}
- QualType PointeeTy = PT->getPointeeType();
-
+ PointeeTy = PT->getPointeeType();
+ }
+ else if (const ReferenceType *RT = T->getAs<ReferenceType>())
+ PointeeTy = RT->getPointeeType();
+ if (!PointeeTy.isNull()) {
bool isReadOnly = false;
// For historical/compatibility reasons, the read-only qualifier of the
// pointee gets emitted _before_ the '^'. The read-only qualifier of
@@ -3559,7 +3564,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
NULL);
return;
}
-
+
if (const ArrayType *AT =
// Ignore type qualifiers etc.
dyn_cast<ArrayType>(T->getCanonicalTypeInternal())) {