diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-22 22:44:46 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-01-22 22:44:46 +0000 |
commit | 0a71ad2e07388c3c0e825bd264dddd549dfc9aea (patch) | |
tree | 7d156341acf8a204d0a68ea3d325c844978bc962 /clang/Driver/RewriteTest.cpp | |
parent | db449040aa0cf16659709e41037204d3b7c62dcf (diff) | |
download | bcm5719-llvm-0a71ad2e07388c3c0e825bd264dddd549dfc9aea.tar.gz bcm5719-llvm-0a71ad2e07388c3c0e825bd264dddd549dfc9aea.zip |
Problem with ObjC's type-encoding of nested structs causing infinit recursion.
llvm-svn: 46260
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index c1243b91edd..eca9349fb68 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/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); |