summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-02-21 23:58:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-02-21 23:58:41 +0000
commit8e1118cbd5867c14095cde313ff517bac4e54891 (patch)
treecdc53120854ac7ea08e2ba2410d21d4a9b857d9c /clang/lib
parentd0dc3920defbd5f6b955712b54cd185de687f584 (diff)
downloadbcm5719-llvm-8e1118cbd5867c14095cde313ff517bac4e54891.tar.gz
bcm5719-llvm-8e1118cbd5867c14095cde313ff517bac4e54891.zip
modern objc translator: fixes a bug where a class declaration with not
any implementation in tu was not being translated. llvm-svn: 151106
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Rewrite/RewriteModernObjC.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/Rewrite/RewriteModernObjC.cpp b/clang/lib/Rewrite/RewriteModernObjC.cpp
index 6e075f26d8c..9c9526109b2 100644
--- a/clang/lib/Rewrite/RewriteModernObjC.cpp
+++ b/clang/lib/Rewrite/RewriteModernObjC.cpp
@@ -3230,16 +3230,6 @@ void RewriteModernObjC::RewriteObjCInternalStruct(ObjCInterfaceDecl *CDecl,
/// and emits meta-data.
void RewriteModernObjC::RewriteImplementations() {
-
- for (unsigned i = 0, e = ObjCInterfacesSeen.size(); i < e; i++) {
- ObjCInterfaceDecl *CDecl = ObjCInterfacesSeen[i];
- // Write struct declaration for the class matching its ivar declarations.
- // Note that for modern abi, this is postponed until the end of TU
- // because class extensions and the implementation might declare their own
- // private ivars.
- RewriteInterfaceDecl(CDecl);
- }
-
int ClsDefCount = ClassImplementation.size();
int CatDefCount = CategoryImplementation.size();
@@ -5022,6 +5012,15 @@ void RewriteModernObjC::HandleTranslationUnit(ASTContext &C) {
RewriteObjCProtocolMetaData(*I, Preamble);
InsertText(SM->getLocForStartOfFile(MainFileID), Preamble, false);
+ for (unsigned i = 0, e = ObjCInterfacesSeen.size(); i < e; i++) {
+ ObjCInterfaceDecl *CDecl = ObjCInterfacesSeen[i];
+ // Write struct declaration for the class matching its ivar declarations.
+ // Note that for modern abi, this is postponed until the end of TU
+ // because class extensions and the implementation might declare their own
+ // private ivars.
+ RewriteInterfaceDecl(CDecl);
+ }
+
if (ClassImplementation.size() || CategoryImplementation.size())
RewriteImplementations();
OpenPOWER on IntegriCloud