aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Driver/RewriteTest.cpp')
-rw-r--r--Driver/RewriteTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 999b0796a9..026c5d62c4 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -329,6 +329,17 @@ void RewriteTest::RewriteInterfaceDecl(ObjcInterfaceDecl *ClassDecl) {
endBuf += Lexer::MeasureTokenLength(LocEnd, *SM);
std::string ResultStr;
+ if (!ObjcForwardDecls.count(ClassDecl)) {
+ // we haven't seen a forward decl - generate a typedef.
+ ResultStr += "typedef struct ";
+ ResultStr += ClassDecl->getName();
+ ResultStr += " ";
+ ResultStr += ClassDecl->getName();
+ ResultStr += ";";
+
+ // Mark this typedef as having been generated.
+ ObjcForwardDecls.insert(ClassDecl);
+ }
SynthesizeObjcInternalStruct(ClassDecl, ResultStr);
Rewrite.ReplaceText(LocStart, endBuf-startBuf,