aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-01-22 22:44:46 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-01-22 22:44:46 +0000
commit7d6b46d9a9d75dea8ef9f6973dd50633c1f37963 (patch)
tree6cb0465d2f3e2303372075864c872f087fdcebdf /Driver/RewriteTest.cpp
parent655398244fc839638fe1a3e0a27a15d5a6d7e0d8 (diff)
Problem with ObjC's type-encoding of nested structs causing infinit recursion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index c1243b91ed..eca9349fb6 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -42,6 +42,7 @@ namespace {
llvm::DenseMap<ObjCMethodDecl*, std::string> MethodInternalNames;
llvm::SmallVector<Stmt *, 32> Stmts;
llvm::SmallVector<int, 8> ObjCBcLabelNo;
+ llvm::SmallVector<const RecordType *, 8> EncodingRecordTypes;
FunctionDecl *MsgSendFunctionDecl;
FunctionDecl *MsgSendSuperFunctionDecl;
@@ -1226,7 +1227,8 @@ Stmt *RewriteTest::RewriteAtEncode(ObjCEncodeExpr *Exp) {
// Create a new string expression.
QualType StrType = Context->getPointerType(Context->CharTy);
std::string StrEncoding;
- Context->getObjCEncodingForType(Exp->getEncodedType(), StrEncoding);
+ Context->getObjCEncodingForType(Exp->getEncodedType(), StrEncoding,
+ EncodingRecordTypes);
Expr *Replacement = new StringLiteral(StrEncoding.c_str(),
StrEncoding.length(), false, StrType,
SourceLocation(), SourceLocation());
@@ -2516,7 +2518,8 @@ void RewriteTest::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
Result += (*IVI)->getName();
Result += "\", \"";
std::string StrEncoding;
- Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding);
+ Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding,
+ EncodingRecordTypes);
Result += StrEncoding;
Result += "\", ";
SynthesizeIvarOffsetComputation(IDecl, *IVI, Result);
@@ -2526,7 +2529,8 @@ void RewriteTest::RewriteObjCClassMetaData(ObjCImplementationDecl *IDecl,
Result += (*IVI)->getName();
Result += "\", \"";
std::string StrEncoding;
- Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding);
+ Context->getObjCEncodingForType((*IVI)->getType(), StrEncoding,
+ EncodingRecordTypes);
Result += StrEncoding;
Result += "\", ";
SynthesizeIvarOffsetComputation(IDecl, (*IVI), Result);