Commit Graph
596 Commits
Author SHA1 Message Date
Kelly Wilson cc02076479 Fix shl/r bad operand size error 2009-02-15 16:26:12 -07:00
Frits van Bommel 2dec6aeb41 Implement implicit return after inline asm on x86_64 2009-02-15 18:04:22 +01:00
Christian Kamm f0dc6cb13e Static ctors/dtors added via template mixins should not be added to modules
that just import a module containing such a mixin.
2009-02-15 14:54:36 +01:00
Christian Kamm 0676cf018d Make sure debug info uses the right compilation units - in particular the
current cu if a symbol is a template instance. Fixes #211.
2009-02-14 21:18:47 +01:00
Tomas Lindquist Olsen 4dee095dc3 Added support for using a temporary to implement emulated ABI return from inline asm, could be easier to use, but I think this will do. It's so extremely target dependent in any case that doing a completely generic approach seems hard. 2009-02-14 15:25:48 +01:00
Christian Kamm cedd029720 Automated merge with http://hg.dsource.org/projects/ldc 2009-02-12 18:39:14 +01:00
Christian Kamm b3524ef5f4 Now that we're using LLVM 2.5, we can stop always running the
CFGSimplification pass.

The pass was originally added as a workaround for a LLVM 2.4 bug where debug
info would reference labels that have been optimized away.
2009-02-12 18:39:03 +01:00
Kelly Wilson 6511dc8239 Revert return value swapping on x86_64 2009-02-11 08:32:33 -07:00
Kelly Wilson 707c7bc29f changes to get the naked asm stuff working for x64 2009-02-10 08:02:25 -07:00
Christian Kamm a4ca550874 Revert templates to old behavior.
While emitting a template instantiation only once is good for compile times
and binary sizes, it doesn't work with linkonce linkage as inlined function
bodies could be discarded. Since we don't want to inhibit inlining, templates
are reverted to the previous behavior, where an instantiation is emitted for
each module using it.

In the future, a custom inlining pass may allow us to switch back to
common/weak linkage and reenable smart template instance emission.
2009-02-08 21:44:46 +01:00
Christian Kamm 789eefd943 Switch some getModule to getCompilationModule to make sure templates are
emitted in the right module.
2009-02-08 18:51:32 +01:00
Christian Kamm 7c93355672 Mostly rewrite debug info generation in terms of llvm/Analysis/DebugInfo.h.
Add getCompilationModule to Dsymbol and fix template compile unit decision code.
Runtime compiles with -g again.
2009-02-08 16:50:22 +01:00
Tomas Lindquist Olsen fc480b7fd8 SWITCHED TO LLVM 2.5 !
Applied patch from ticket #129 to compile against latest LLVM. Thanks Frits van Bommel.

Fixed implicit return by asm block at the end of a function on x86-32. Other architectures will produce an error at the moment. Adding support for new targets is fairly simple.

Fixed return calling convention for complex numbers, ST and ST(1) were switched around.

Added some testcases.

I've run a dstress test and there are no regressions. However, the runtime does not seem to compile with symbolic debug information. -O3 -release -inline works well and is what I used for the dstress run. Tango does not compile, a small workaround is needed in tango.io.digest.Digest.Digest.hexDigest. See ticket #206 .
2009-02-08 05:26:54 +01:00
Tomas Lindquist Olsen 3f7c7c5327 Fixed accessing function symbols from inline asm.
Ran x86(-64) asm processors through a code formatter.
2009-02-08 05:14:24 +01:00
Tomas Lindquist Olsen 54c3e2cf0c Reverted the template instantiation changes from rev [940]. Wasn't safe it seems :( 2009-02-05 18:17:42 +01:00
Tomas Lindquist Olsen 9bd52922bd Changed the way LDC determines if a template instantiation needs to get a definition, seems to speed up compile times quite a bit in some cases. 2009-02-04 18:48:03 +01:00
Christian Kamm a1e6510c39 Automated merge with http://hg.dsource.org/projects/ldc 2009-02-04 18:39:39 +01:00
Christian Kamm c3cdcab8d2 Convert struct arg to integer when passing inreg to make sure LLVM doesn't
ignore the attribute!
2009-02-04 18:39:33 +01:00
Tomas Lindquist Olsen 7d2a0a84a7 Removed some dead code.
Fixed assertion filenames for imported template instances. Fixes #152 .
2009-02-04 02:10:23 +01:00
Kelly Wilson 6cd6ddd237 Fixed an accidental code removal for osx 2009-02-03 17:27:01 -07:00
Tomas Lindquist Olsen 584911ad4e Fixed problem with static ctors, in templated imported classes, not begin run. Fixes #203 2009-02-04 00:50:04 +01:00
Tomas Lindquist Olsen bd4f7ec731 Replace assertion with errormessage for unsupported calling conventions. like Pascal. See dstress/run/e/extern_10_A.d 2009-02-04 00:04:09 +01:00
Tomas Lindquist Olsen 280be5ef8e Fixed dstress/run/a/array_initialization_17_A.d regression. default initialized static array elements in a constant static array initializer was getting incorrect values.
Fixed minor version problem in mini/naked_asm4.d test case.
2009-02-03 23:48:47 +01:00
Christian Kamm c1aeab8c07 Automated merge with http://hg.dsource.org/projects/ldc 2009-02-03 21:46:54 +01:00
Christian Kamm bbcea86cf2 Follow the D ABI and pass the last arg in a register if it is a struct that fits. 2009-02-03 21:46:46 +01:00
Kelly Wilson 4ab57fab42 Changed this file to add 'naked' and a couple other missing instructions 2009-02-03 12:43:03 -07:00
Tomas Lindquist Olsen 9705b7e017 Fixed problem accessing global variables from naked asm on osx. 2009-02-03 18:42:25 +01:00
Tomas Lindquist Olsen e7125498e2 Added support for naked asm on OSX. (hopefully!) 2009-02-03 18:14:30 +01:00
Tomas Lindquist Olsen dc5944df99 Implemented proper support for naked asm using llvm module level asm. Still not 100% complete, but already 1000 times better that what we had before. Don's BignumX86 implementation from Tango (when turned into a standalone unittest) seems to fully work with no changes, and great performance :)
Fixed align N; in asm blocks.

Fixed inreg parameter passing on x86 for ref/out params.

Removed support for lazy initialization of function local static variables, I have no idea why I ever implemented this, it's not in the D spec, and DMD doesn't support it :P

Some of the global variable related changes might cause minor regressions, but they should be easily fixable.
2009-02-03 08:54:57 +01:00
Tomas Lindquist Olsen 8ab98dad49 Fixed assertion failure when object.d is missing the ModuleInfo class 2009-02-02 02:35:44 +01:00
Tomas Lindquist Olsen 75591b3c16 Changed templates and typeinfo to use linkonce linkage instead of weak linkage, this should fix inlining problems, fixing bug #197 . If problems show up, it's easy to change it back by changing the define in mars.h . I'm 95% sure this is safe, given how we handle templates. 2009-02-02 01:44:51 +01:00
Tomas Lindquist Olsen 98974b02c0 Fix bug #199 2009-02-02 00:26:32 +01:00
Tomas Lindquist Olsen e6ef3ecf15 Fixed bug #191 by rewriting DtoConstArrayInitializer, patch unfortunately caused regressions, hopefully this doesn't :P 2009-02-01 23:30:36 +01:00
Christian Kamm 01f19c466c Fix #198 and #199 by making CTFE on static struct initializers work.
Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
2009-02-01 20:20:56 +01:00
Christian Kamm f82ca73c76 Casts from interface to class generally need to be dynamic. Fixes #189. 2009-01-25 12:35:11 +01:00
Christian Kamm 343b80e718 Fix bug #177 by not attempting to define composite debug info for
forward-declared structs.
2009-01-23 13:41:03 +01:00
Christian Kamm 287fa3446c Add -m64 switch to gcc calls on 64-bit platforms. 2009-01-23 10:12:57 +01:00
Christian Kamm ab9b9cc2e9 Solaris compatibility and proc map parsing #183, thanks BlueZeniX! 2009-01-22 18:53:32 +01:00
Tomas Lindquist Olsen 343003cfdc Makes sure only function definitions inside templates get weak linkage, llvm doesn't allow weak linkage on just declarations, so we use external linkage for those. Fixes #162 2009-01-22 17:26:50 +01:00
Christian Kamm 4042f90800 Apply afb's patch from #168 to use $CC instead of "gcc" for toobj and linker. 2009-01-17 17:52:09 +01:00
Christian Kamm 9081e55746 Fix #163. 2009-01-17 14:53:32 +01:00
Tomas Lindquist Olsen 0816e84138 Fixed bad return types in typinf.cpp 2009-01-09 20:08:06 +01:00
Tomas Lindquist Olsen 16409a3367 Merged DMD 1.038 2009-01-06 16:33:51 +01:00
Christian Kamm 955df981f8 Apply duane's patch for align power-of-two checking in inline asm. Fixes #159 2009-01-04 15:39:34 +01:00
Christian Kamm 12a21b1397 Fix #153. Factor out common code in StructLiteralExp::to(Const)Elem. 2008-12-30 11:42:01 +01:00
Christian Kamm c92946a00a Automated merge with http://hg.dsource.org/projects/ldc 2008-12-20 09:15:46 +01:00
Christian Kamm 61a5a08135 Adjust error message for missing toConstExp to include 'is not a const exp'. 2008-12-20 09:13:44 +01:00
elrood 4c3d23ddfe modified gen/linker.cpp to only append .exe suffix on windows if not already present 2008-12-18 19:24:33 +01:00
Christian Kamm 8f62c080e2 Add more toConstElem stubs to get better error messages. 2008-12-18 07:59:03 +01:00
Christian Kamm 7069073f75 Applied modification of wilsonk's patch for AndAnd and OrOrExp for void rhs funcs. 2008-12-17 21:24:17 +01:00