diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-26 20:22:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-26 20:22:11 +0000 |
commit | c1868e533e63a1b7dad7a22714fc593c045382ae (patch) | |
tree | 2fcd658d7b3d04b266cf8b3cf27400d52580bb68 /lib/CodeGen/CodeGenModule.cpp | |
parent | ccb428bb04adaa909431d6e929b8f9e6bdbe7208 (diff) |
objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 5425eaf64e..65ba91a638 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2582,8 +2582,15 @@ void CodeGenModule::EmitLinkageSpec(const LinkageSpecDecl *LSD) { } for (RecordDecl::decl_iterator I = LSD->decls_begin(), E = LSD->decls_end(); - I != E; ++I) + I != E; ++I) { + if (ObjCImplDecl *OID = dyn_cast<ObjCImplDecl>(*I)) { + for (ObjCContainerDecl::method_iterator M = OID->meth_begin(), + MEnd = OID->meth_end(); + M != MEnd; ++M) + EmitTopLevelDecl(*M); + } EmitTopLevelDecl(*I); + } } /// EmitTopLevelDecl - Emit code for a single top level declaration. |