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:
Martin 2017-10-26 20:24:03 +02:00
parent 183f97cd4e
commit 95915a8ab8
9 changed files with 130 additions and 112 deletions

View file

@ -35,7 +35,7 @@ IRScope &IRScope::operator=(const IRScope &rhs) {
////////////////////////////////////////////////////////////////////////////////
IRState::IRState(const char *name, llvm::LLVMContext &context)
: module(name, context), DBuilder(this) {
: module(name, context), DBuilder(this), objc(module) {
ir.state = this;
}