Commit Graph

168 Commits

Author SHA1 Message Date
Alexey Prokhin
925303e334 New compact layout of ModuleInfo objects 2012-02-15 13:23:22 +04:00
Alexey Prokhin
91f4e5d015 Added emission of dwarf lexical blocks.
Also, dropped support for DISABLE_DEBUG_INFO definition.
2011-12-04 15:34:35 +04:00
kai
8db112dd68 Stream for object file must have binary flags. 2011-11-27 21:26:44 +01:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00
Alexey Prokhin
b97b32759e Use LLVM Machine Code (MC) to emit object files. Finilize debug info 2011-10-25 15:43:49 +04:00
Alexey Prokhin
629f13929e WIP: port to llvm 3.0 2011-10-25 15:43:39 +04:00
David Nadlinger
7a24e12736 Cleanup: Remove unused code in backend, silence some warnings.
This removed quite some clutter that has presumably piled up because LDC is seldom built with a lot of warnings enabled due to DMDFE.
2011-04-24 12:21:33 +02:00
Kelly Wilson
72ea043124 Recommit klickverbot's patch for LLVM-2.9. 2011-04-20 09:28:37 -06:00
Kelly Wilson
7c81278b9c Backed out changeset 5253bfbb3890 2011-04-20 00:28:23 -06:00
Kelly Wilson
b26b0f4196 Upgrade to LLVM-2.9. Thanks to David Nadlinger for the patch. 2011-04-19 21:57:15 -06:00
Alexey Prokhin
3a2aedc9ac Fix building of the runtime as a shared library 2011-03-26 17:58:05 +03:00
Alexey Prokhin
8a49067776 Increment vgates in static constructors. That fixes static destructors of templates. 2011-01-02 17:43:02 +03:00
Alexey Prokhin
a86f414bc1 Fixed calling of _d_array_bounds and _d_switch_error. 2011-01-02 17:43:02 +03:00
Alexey Prokhin
8d7ff66019 Fixed the order of static destructors 2010-12-30 14:04:24 +03:00
Alexey Prokhin
14c6dfb895 Added pointers to shared constructors and destructors to ModuleInfo. 2010-11-05 17:40:29 +03:00
Alexey Prokhin
d0c7a5a3cb Ported to new debug information format introduced in llvm 2.7 2010-10-30 20:57:32 +04:00
Alexey Prokhin
4d7a6eda23 Different fixes for d2 2010-10-07 22:35:32 +04:00
Tomas Lindquist Olsen
1fac40d2bd Update to work with LLVM 2.7.
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.
2010-05-19 12:42:32 +02:00
Benjamin Kramer
a54bf33d4b This flush is not needed anymore. 2009-08-25 21:21:37 +02:00
Benjamin Kramer
d24643bb50 Avoid some unecessary heap allocations by using llvm's StringRef class. 2009-08-14 01:43:30 +02:00
Benjamin Kramer
c220dcac05 IntegerType is now contextifed.
Requires llvm >= 78969. resistor says this will be the last context API change :)
2009-08-14 00:39:18 +02:00
Benjamin Kramer
977fa551ee Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
2009-08-06 01:47:39 +02:00
Benjamin Kramer
e05d3d8c3a lookupTarget no longer takes a Module.
And we need to get TargetData from the module if the Target
doesn't have it.
2009-08-04 12:21:59 +02:00
Benjamin Kramer
4c5457ba61 getNullValue is in Constant again
Requires LLVM >= r77721
2009-07-31 23:01:29 +02:00
Benjamin Kramer
66101517d7 LLVMContext changes up to r77366 2009-07-30 15:25:10 +02:00
Benjamin Kramer
51c02d192a Some minor cleanups
* 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
2009-07-20 18:16:11 +02:00
Benjamin Kramer
03020aea39 raw_fd_ostream takes a force parameter now
Build fix for LLVM 75801.
2009-07-15 20:04:42 +02:00
Benjamin Kramer
23b83c4d7b Target.addPassesToEmitFile takes a formatted_raw_ostream now
Build fix for LLVM r75670
2009-07-14 23:06:31 +02:00
Benjamin Kramer
0ee2f34611 Don't use llvm::getGlobalContext() anymore 2009-07-13 20:16:15 +02:00
Benjamin Kramer
331319dab1 Build fix for the latest LLVMContext changes (LLVM r75445)
This shouldn't break the build with older LLVM revs. We include
LLVMContext.h in gen/llvm.h now to make the transition a little bit
easier.
2009-07-13 12:17:58 +02:00
Benjamin Kramer
45f7401a5b Remove all of the now unecessary #if LLVM_REV 2009-07-11 14:09:33 +02:00
Christian Kamm
756a2cb2a1 Adjust LDC to work with the LLVMContext LLVM changes.
This means we now require a fairly new LLVM revision. I use 75234.
2009-07-10 21:30:02 +02:00
Benjamin Kramer
22b36384b0 Fix build for LLVM >= r74640
Some LLVM objects now take a 'Context' to make multi-threaded apps easier.
Since we're not multi-threaded it's safe to use llvm::getGlobalContext()
which gives us the same behavior as we had before.
2009-07-03 17:24:35 +02:00
Frits van Bommel
4158fb474a Add an llvm::OStream workalike class for use with Logger::cout(), with the
crucial difference being special handling of `llvm::Type`s so they get printed
by name rather than printing their full representation (which can be positively
*huge*).

This allows re-enabling some logger calls that were disabled due to extreme
verbosity.
2009-06-16 19:31:10 +02:00
Christian Kamm
b4f8bd6e52 Fix #318 by making a list of all seen template instances in a module for
singleobj compilation and then making sure they get emitted in their entirety.
2009-06-06 09:47:32 +02:00
Frits van Bommel
060d18b91e Fix a bug in DtoNestedInit and update an unrelated comment. 2009-06-03 12:32:35 +02:00
Tomas Lindquist Olsen
092381577f Some minor changes to handling of variables referenced from nested functions in D2 .
Added generation of new 'void*[4] reserved;' !ModuleInfo member .
2009-06-03 03:04:47 +02:00
Robert Clipsham
435d3069f6 Automated merge with http://hg.dsource.org/projects/ldc 2009-06-02 17:12:37 +01:00
Frits van Bommel
fd037f35e9 Fix a type mismatch in ModuleInfo generation. 2009-06-01 23:17:47 +02:00
Robert Clipsham
91ddf6140a More tweaks. 2009-06-01 18:58:21 +01:00
Tomas Lindquist Olsen
b64ad3299e Use RTTIBuilder to build !ModuleInfo, still needs some work. 2009-05-17 17:04:47 +02:00
Tomas Lindquist Olsen
9be5694168 Added error messages when failed to open files for .bc and .ll output, instead of just trying to write to the stream, pretty similar to the #281 problem. 2009-05-17 14:40:09 +02:00
Tomas Lindquist Olsen
0a77bd9fa6 Add error message when failed to open output stream for native asm output. Fixes ticket #281 . 2009-05-17 14:20:27 +02:00
Tomas Lindquist Olsen
c0f2af5afd Added IrTypeFunction and IrTypeDelegate and eliminated IrDType. This means the Type::ir field can be removed. It's the final part needed for the move to a slightly more sane type system. Now the whole thing just needs to be cleaned up :P
Added -v-cg switch, which right now just prints "codegen: module.name (module/name.d)" to stdout, this can really help figuring out where, in some complex build command, things go wrong.
2009-05-16 18:19:52 +02:00
Frits van Bommel
57fc3463f6 Run backend without optimizations when no optimization parameters were used,
even when not generating debug info.
2009-05-10 20:22:08 +02:00
Frits van Bommel
cf0b8936ce Factor out the code to find gcc, and add a command-line option to override the
default executable name.
This should help cross-compilation by allowing a cross-gcc to be specified from
the configuration file instead of only through the CC environment variable.
2009-05-04 13:32:16 +02:00
Frits van Bommel
96108f8e7c Now the backend wants an enum value as optimization level.
Hopefully this'll be the last change to that code...
2009-04-30 11:56:03 +02:00
Frits van Bommel
b9849d86b6 Update codegen to (hopefully) work correctly with newer LLVM trunk, where
there's no longer a Fast flag. (It has been replaced by an optimization level)
Untested because I haven't compiled that recent an LLVM yet :).
2009-04-29 10:26:28 +02:00
Tomas Lindquist Olsen
95b94935ee Moved special casing of 'assert(this, "null this");' generated statements from !ThisExp into !AssertExp.
Fixed filenames for array bounds errors and probably others, fixes #271 .
2009-04-27 13:30:48 +02:00
Christian Kamm
17dbddfe41 Force 'fast' compilation when debug info is requested. LLVM trunk seems to
skip debug info for non-fast compilation.
2009-04-26 18:21:07 +02:00