[cfe-commits] r68729 - in /cfe/trunk: lib/AST/ASTContext.cpp test/CodeGenObjC/encode-test-5.m
Anders Carlsson
andersca at mac.com
Thu Apr 9 14:55:45 PDT 2009
Author: andersca
Date: Thu Apr 9 16:55:45 2009
New Revision: 68729
URL: http://llvm.org/viewvc/llvm-project?rev=68729&view=rev
Log:
Add @encode support for complex types.
Added:
cfe/trunk/test/CodeGenObjC/encode-test-5.m
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=68729&r1=68728&r2=68729&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Apr 9 16:55:45 2009
@@ -2266,8 +2266,11 @@
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);
Added: cfe/trunk/test/CodeGenObjC/encode-test-5.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjC/encode-test-5.m?rev=68729&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjC/encode-test-5.m (added)
+++ cfe/trunk/test/CodeGenObjC/encode-test-5.m Thu Apr 9 16:55:45 2009
@@ -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);
+
More information about the cfe-commits
mailing list