Add some of the sanitizer passes to LDC. This is not complete (linking must be
done using clang and the right `-fsanitize=` option) and may not be useful at
all.
If it proves to be usefull then a lot of other options (e.g. blacklist) must be
added.
There might be still some pieces left here and there, and
there is certainly code that could be rewritten in a nicer
way with the 3.0 requirement out of the picture.
I have seen it used several times in benchmarks comparing it
to 'gdc -O3' and 'dmd -O -inline' now, so people apparently
expect it to yield the highest available optimization level.
1. Main include corresponding to .cpp file, if any.
2. DMD and LDC includes.
3. LLVM includes.
4. System includes.
Also updated a few include guards to match the default format.
-disable-simplify-drtcalls was only intended to disable our
custom druntime call simplication pass for debugging purposes.
The new flag controls C runtime library calls optimizations as
performed by the LLVM pass, just as the corresponding LLVM tool
flags do.
- New functions codeGenOptLevel() and verifyModule() to remove code duplication
- Hidden option no-verify renamed to disable-verify and moved to optimizer (like opt tool)
- Removed global.params.noVerify
Removed use of dyn_cast, llvm no compiles
without exceptions and rtti by
default. We do need exceptions for the libconfig stuff, but rtti isn't
necessary (anymore).
Debug info needs to be rewritten, as in LLVM 2.7 the format has
completely changed. To have something to look at while rewriting, the
old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means
that you have to define this to compile at the moment.
Updated tango 0.99.9 patch to include updated EH runtime code, which is
needed for LLVM 2.7 as well.
* remove an #ifdef USE_METADATA I accidently left in
* remove now unneeded llvm-version includes
* fix indentation in metadata.h
* prevent the "Found native target" message from interrupting ccmake
allocations too. (A "simple" loop is one where the allocation isn't used in a
subsequent iteration)
This also means it's no longer necessary to run this pass multiple times.
Running it once after inlining should now catch all cases.
`available_externally` linkage. This allows the inliner to inline functions from
other modules while telling the code generator to ignore those functions (treat
them as declarations)
Still generates a few extra `TypeInfo`s and strings...
Disabled when generating debug info because I don't really understand it, and it
doesn't like this.
to generate asm for code with metadata globals.
This new pass is used as a workaround: it strips metadata from the module before
it reaches the code generator.
Obviously, this is disabled if LLVM doesn't support metadata.