Add @encode support for complex types.

llvm-svn: 68729
This commit is contained in:
Anders Carlsson 2009-04-09 21:55:45 +00:00
parent e65fd1a302
commit 39b2e130f0
2 changed files with 16 additions and 2 deletions

View File

@ -2266,8 +2266,11 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
S += encoding;
}
}
else if (T->isObjCQualifiedIdType()) {
} else if (const ComplexType *CT = T->getAsComplexType()) {
S += 'j';
getObjCEncodingForTypeImpl(CT->getElementType(), S, false, false, 0, false,
false);
} else if (T->isObjCQualifiedIdType()) {
getObjCEncodingForTypeImpl(getObjCIdType(), S,
ExpandPointedToStructures,
ExpandStructures, FD);

View File

@ -0,0 +1,11 @@
// RUN: clang-cc -triple=i686-apple-darwin9 -fnext-runtime -emit-llvm -o %t %s &&
// RUN: grep ji %t | count 1 &&
char *a = @encode(_Complex int);
// RUN: grep jf %t | count 1 &&
char *b = @encode(_Complex float);
// RUN: grep jd %t | count 1
char *c = @encode(_Complex double);