David Nadlinger
4ae14449ea
Emit new TypeInfo layout.
...
Includes untested support for RTInfo.
2012-09-07 03:51:32 +02:00
kai
2dbee75523
Prefer C++-style casts.
...
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-02 19:55:29 +02:00
Alexey Prokhin
014d6bdd4d
Merged 2.056
2011-12-02 21:50:52 +04:00
Alexey Prokhin
4ab6869c50
Fix a crash which occurs when compiling std/conv.d with unittests
2011-11-01 17:06:13 +04:00
Alexey Prokhin
40fa7653e2
Sync TypeInfoClass flags with dmd
2011-11-01 12:07:59 +04:00
Alexey Prokhin
66a30803f3
Fixed an assert in DtoNewClass when initializing an inner-class outer reference
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
Alexey Prokhin
f0a183f0e8
Fix a crash when compiling a file which contains an immutable class declaration
2011-02-20 19:00:53 +03:00
Alexey Prokhin
48d89916ef
Work on typeinfo.
2010-12-19 15:50:44 +03:00
Alexey Prokhin
360a99caa9
Resolving nested context for structs.
...
* * *
Another fix for nested structs
* * *
Yet another fix for nested structs
2010-11-02 13:21:36 +03:00
Alexey Prokhin
4d7a6eda23
Different fixes for d2
2010-10-07 22:35:32 +04:00
Christian Kamm
3479e91996
Merge DMD 1.051
2009-11-06 23:58:01 +01:00
Robert Clipsham
089e792258
DMD 2.032 Merge.
2009-09-08 10:07:56 +01: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
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
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
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
Frits van Bommel
96fdcd6347
Run semantic3
on imported modules, and emit new symbols with
...
`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.
2009-06-07 16:00:13 +02:00
Tomas Lindquist Olsen
f6997cb604
D2:
...
Applied function type from D1 frontend that got removed in D2, it's critical for member function type to be correct.
Fixed a bunch of type discrepancies in druntime object.di vs. genobj.d .
Disabled (#if 0) some potentally very large type dumps for -vv .
Updated classinfo and typeinfo generation for D2, almost complete now.
Added finer grained checks for vtbl type mismatching, aids debugging.
2009-06-03 02:28:48 +02:00
Robert Clipsham
cf08cc2844
Automated merge with http://hg.dsource.org/projects/ldc
2009-06-01 19:02:20 +01:00
Robert Clipsham
91ddf6140a
More tweaks.
2009-06-01 18:58:21 +01:00
Frits van Bommel
da593c99dc
Remove code duplication for vtable loads and improve instruction naming to make
...
bitcode with virtual calls easier to read.
2009-05-30 13:04:49 +02:00
Tomas Lindquist Olsen
be25445461
Added simple check for ClassInfo change introduced in DMD 1.045, it must have 12 fields.
2009-05-17 23:15:04 +02:00
Tomas Lindquist Olsen
0b8413b4bc
Fixed class -> integer casts.
2009-05-17 22:02:03 +02:00
Tomas Lindquist Olsen
b1fa43ce24
Increased RTTIBuilder buffer to 14 constants, to be big enough for !ClassInfo as well as !TypeInfo
2009-05-17 16:29:49 +02:00
Tomas Lindquist Olsen
dc4b7e8118
Update !ClassInfo generation to use !RTTIBuilder, slight update of !RTTIBuilder .
2009-05-17 16:27:01 +02:00
Tomas Lindquist Olsen
6633d696c9
Forgot to set the (ClassInfo.flags & 32) bit added in 1.045.
2009-05-16 22:24:49 +02:00
Tomas Lindquist Olsen
e8780d50e8
Merged DMD 1.045 !!!
2009-05-16 22:21:31 +02:00
Tomas Lindquist Olsen
f5d635dfc7
Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 .
2009-05-14 13:26:40 +02:00
Tomas Lindquist Olsen
ca4f588c08
Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 .
2009-05-07 02:10:29 +02:00
Tomas Lindquist Olsen
ba38e15f0d
Fixed class default initializers and type generation. Bug #260 is fixed.
2009-04-27 03:40:40 +02:00
Tomas Lindquist Olsen
3e882d422b
Fixed struct default initializers.
2009-04-25 18:26:54 +02:00
Tomas Lindquist Olsen
575038bfbd
Fixed classinfo.interfaces for .. interfaces!
2009-04-21 20:19:53 +02:00
Tomas Lindquist Olsen
4567a55f7f
Fixed emitting declarations nested inside interfaces.
2009-04-21 19:32:22 +02:00
Tomas Lindquist Olsen
f5ce8eda1d
Resolve all base classes, including interfaces (!) before resolving the class itself.
2009-04-17 03:01:43 +02:00
Tomas Lindquist Olsen
803fbf4882
Make !TypeInfo output lazy unless we need to provide full definitions in general.
2009-04-16 22:20:26 +02:00
Tomas Lindquist Olsen
9a86f9c0b5
Fixed some minitest regressions.
2009-04-16 19:21:30 +02:00
Tomas Lindquist Olsen
bb98d68f64
Now compiles again, and fixed type of the Interface[N] ClassInfo symbol.
2009-04-16 11:01:49 +02:00
Tomas Lindquist Olsen
37cf5a5789
Added Doxygen file.
...
Completely seperated type and symbol generation. Should fix a lot of bugs, but is not yet 100% complete.
2009-04-15 20:06:25 +02:00
Frits van Bommel
071bad95dc
Add some alignment info where LLVM might otherwise be more pessimistic.
...
In particular, %.nest_arg is always aligned even though it's bitcast from i8*.
Pointers in vtables are also guaranteed to be stored at aligned addresses.
2009-04-12 21:56:43 +02:00
Frits van Bommel
b5af30636e
Isolate all knowledge of what a function's nested context looks like in a
...
single place. No functional change.
2009-04-12 13:08:24 +02:00
Tomas Lindquist Olsen
be3bfbff5d
Fixed problems introduced by previous commits that prevented Tango from compiling.
2009-03-27 23:17:04 +01:00
Tomas Lindquist Olsen
ec986231e5
Eliminated the need for resolve, declare, const-init and define lists to drive code generation.
2009-03-27 21:50:32 +01:00
Tomas Lindquist Olsen
daef67acc3
Changed use of toObjFile to a new codegen method.
...
More versioning of DMD specific codegen code.
2009-03-27 17:54:27 +01:00
Frits van Bommel
d0a8ee9573
Return null from a static class to interface cast if the class reference was
...
null. Fixes #237 .
2009-03-20 15:50:01 +01:00
Frits van Bommel
27d3ab4546
Some calling convention work for x86-64:
...
- Implement x86-64 extern(C), hopefully correctly.
- Tried to be a bit smarter about extern(D) while I was there.
Interestingly, this code seems to be generating more efficient code than
gcc and llvm-gcc in some edge cases, like returning a `{ [7 x i8] }` loaded from
a stack slot from an extern(C) function. (gcc generates 7 1-byte loads, while
this code generates a 4-byte, a 2-byte and a 1-byte load)
I also added some changes to make sure structs being returned from functions or
passed in as parameters are stored in memory where the rest of the backend seems
to expect them to be. These should be removed when support for first-class
aggregates improves.
2009-03-06 16:00:47 +01:00
Frits van Bommel
dd41366a99
Use llvm::CallSite instead of custom CallOrInvoke class.
2009-02-28 22:16:52 +01:00