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 | 2d26c29e0cdd204c28066ed2ae77c22432308690 (patch) | |
tree | 4de07fcc2274c5c1cd9c3e97a1abc4e88706cc82 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | c2c77c42efaf7a7c91be9428373ad8045a2d647c (diff) | |
download | bcm5719-llvm-2d26c29e0cdd204c28066ed2ae77c22432308690.tar.gz bcm5719-llvm-2d26c29e0cdd204c28066ed2ae77c22432308690.zip |
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
llvm-svn: 166809
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 5425eaf64eb..65ba91a6389 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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. |