mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Fix and refactor Objective-C state
Tie the state to an LLVM module/object file instead of having a global one. And finalize it once per LLVM module instead of once per D module (previously, as part of ModuleInfo generation). Fixes issue #2388.
This commit is contained in:
parent
183f97cd4e
commit
95915a8ab8
9 changed files with 130 additions and 112 deletions
|
@ -15,7 +15,6 @@
|
|||
#include "gen/llvmhelpers.h"
|
||||
#include "gen/logger.h"
|
||||
#include "gen/mangling.h"
|
||||
#include "gen/objcgen.h"
|
||||
#include "gen/rttibuilder.h"
|
||||
#include "ir/irfunction.h"
|
||||
#include "ir/irmodule.h"
|
||||
|
@ -306,8 +305,6 @@ llvm::GlobalVariable *genModuleInfo(Module *m) {
|
|||
const auto at = llvm::ArrayType::get(it, len);
|
||||
b.push(toConstantArray(it, at, name, len, false));
|
||||
|
||||
objc_Module_genmoduleinfo_classes();
|
||||
|
||||
// Create a global symbol with the above initialiser.
|
||||
LLGlobalVariable *moduleInfoSym = getIrModule(m)->moduleInfoSymbol();
|
||||
b.finalize(moduleInfoSym->getType()->getPointerElementType(), moduleInfoSym);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue