`llvm::AttrBuilder` was changed to require an LLVMContext in its constructor, and can no longer be copied.
declare `DEBIG_TYPE` after includes for the GC2Stack pass as `llvm/Support/GenericDomTreeConstruction.h `(included from `llvm/IR/Dominators.h` `#define`s and `#undef`s it.
`llvm::DIBuilder::createExpression` now takes an `ArrayRef<uint64_t>` instead of `int64_t`. EmitLocalVariable has similarly changed
And streamline implicit -singleobj with DMD, also enforcing it when
compiling a *single* module *and* specifying the -of name.
[-makedeps currently depends on -singleobj.]
This should resolve#3350 and also gets rid of the previous Android-
specific requirement wrt. having a D main *and* making sure that object
file is the first one fed to the linker.
Resolves#3245 by adding `pragma(lib, <name>)` library names to
`llvm.dependent-libraries` for ELF object files.
For Mach-O, embed appropriate linker options for `pragma(lib)` and
support generic `pragma(linkerDirective, <flag>, ...)` as well.
Not all type declarations yet (e.g., some TypeInfo subtypes are still
accessed directly), but those already wrapped as LazyType in the
gen/runtime.cpp module (with check and proper error msg in case object.d
doesn't contain a required declaration).
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.
Postpone the destruction of replaced global variables, register them in
`IRState::globalsToReplace` and perform a second replacement pass when
finalizing the IR module. The globals will be destroyed in that 2nd pass,
so there may still be dangling pointers in `IrGlobal::value`, but now only
after writing the module.
The nicer thing would be replacing IrGlobal::value by IrGlobal::getValue()
which could look it up in IRState, but that's not feasible due to the
field being inherited from IrVar and IrGlobal apparently quite often being
used as IrVar (via pointers union), so the cached field is currently
required.
So the feasible options to me were either registering each IrGlobal with
its mangled name and replacing their values when swapping out the global
variable, or performing this second replacement pass right before
finalizing the IR module to make sure we really replace all occurrences.
I went for the latter as it's both easier and safer (from the LL
perspective as the old global might be cached somewhere else too).
* Fix LLVM 5.0 compilation.
* Fix adding linker option metadata to LLVM module.
See https://reviews.llvm.org/D31349
* Version the SPIRV cache dir on travis.
Just before writing the object file. Module::deleteObjFile() deletes the
doc file too, and generating the docs happens in a prior pass before
codegen.
deleteObjFile() is already called in mars.d, after reading the source
file, before the generate-doc pass.
Fixes dmd-testsuite's runnable/test_switches.sh.