75 Commits

Author SHA1 Message Date
David Nadlinger
5616753768 Consistently use quotes for LLVM includes. 2013-02-07 21:20:54 +01:00
kai
4ea7e8dbf8 Add pragma to install function as global C runtime ctor or dtor.
DMD has the obscure functionality to install functions starting with
_STI_ as global ctors and funtions starting with _STD_ as global
dtors. IMHO a pragma is a better way to specify the behaviour.

This commit adds pragma(LDC_global_crt_ctor) and
pragma(LDC_global_crt_dtor). If the pragma is specified on a function
or static method then an entry is made in the corresponding list. E.g.
in monitor_.d:

    extern (C) {
        #pragma(LDC_global_crt_ctor)
        void _STI_monitor_staticctor()
        {
            // ...
        }
    }

This works on Linux without problems. On Windows with MS C Runtime
ctors work always but dtors are invoked only if linked against the
static C runtime. Dtors on Windows require at least LLVM 3.2.
2012-12-22 21:18:37 +01:00
David Nadlinger
288fd47707 Merged 1.075 frontend. 2012-11-24 21:10:13 +01:00
kai
2173b52aea Make LDC1 compile with LLVM 3.2 trunk. 2012-08-17 15:44:20 +02:00
kai
1c6ff32d50 Merge dmd-1.074 into ldc. 2012-04-13 23:12:46 +02:00
kai
f1998a6110 Minimize differences between original dmd source and ldc1.
Mainly affects formatting but I also found some code differences.
2012-04-10 21:52:12 +02:00
kai
e5f2430855 Remove unused member VarDeclaration::anonDecl. 2012-03-28 06:57:17 +02:00
kai
e739102374 Removed unused member VarDeclaration::offset2. 2012-03-27 07:13:55 +02:00
kai
8a20415cd1 Fix white space. 2012-03-06 07:28:29 +01:00
kai
a23b837ebd Merge dmd-1.073. 2012-02-23 20:41:22 +01:00
kai
f9201e8352 Merge 1.072 2012-02-02 03:13:27 +01:00
Alexey Prokhin
913eda6188 Fixed compilation of ldc1 2011-12-06 17:36:53 +04:00
David Nadlinger
df1c21bd4d Merged DMD commit 2101219b7b3fa5f545af8401dcacd2cb91c8ef08:
bugzilla 5110 Excess attribute propagation of structs and classes
2011-04-22 18:46:11 +02:00
Moritz Warning
f6b7d2a030 merge from ldc2 branch 2011-01-04 20:54:46 +01:00
Robert Clipsham
65c892ee62 Merge SiegeLord's dmdfe 1.064 patch. 2011-01-01 21:23:08 +00:00
Alexey Prokhin
c3ea7b27c6 Work on debug 2010-12-14 14:35:48 +03:00
Moritz Warning
f654235139 fixes #432 :: apply DMDFE 1.063; thanks SiegeLord 2010-09-27 00:07:03 +02:00
Moritz Warning
c4e255206a fixes #431 :: apply DMDFE 1.062; thanks SiegeLord 2010-09-27 00:06:28 +02:00
Moritz Warning
ba275942cf fixes #427 :: Upgrade to DMDFE 1.059+1.060 patch; thanks to SiegeLord 2010-09-05 19:12:55 +02:00
Moritz Warning
ac5180b65b fixes #426 :: detab'ing the DMDFE source; kudos SiegeLord 2010-09-05 19:04:26 +02:00
Robert Clipsham
daa102a5cd Merge dmd 1.056. 2010-02-06 15:53:52 +00:00
Leandro Lucarella
b9896b9034 Merge DMD r314+r315: bugzilla 2029 Typesafe variadic functions don't...
Both DMD revisions are for fixing bugzilla 2029 (Typesafe variadic
functions don't work in CTFE).

The DMD r314 commit message is:
bugzilla 2029 (Typesafe variadic functions don't work in CTFE

The DMD r315 commit message is:
bugzilla 2029 - try again
---
 dmd/constfold.c   |   11 ++++-
 dmd/declaration.c |   21 +++++++++-
 dmd/declaration.h |   10 ++++-
 dmd/expression.c  |    1 +
 dmd/interpret.c   |  111 +++++++++++++++++++++++++++++++++++++++++++++--------
 dmd/mars.h        |    2 +-
 dmd/mtype.c       |    2 +-
 7 files changed, 135 insertions(+), 23 deletions(-)
2010-01-06 15:18:22 -03:00
Leandro Lucarella
4d74a325fc Merge DMD r304: refactor invariant => immutable
---
 dmd/cast.c        |    2 +-
 dmd/declaration.c |    2 +-
 dmd/declaration.h |    3 +--
 dmd/doc.c         |    2 +-
 dmd/expression.c  |    6 +++---
 dmd/interpret.c   |    4 ++--
 dmd/mtype.c       |    2 +-
 dmd/mtype.h       |    2 +-
 dmd/parse.c       |    4 ++--
 dmd/struct.c      |    2 +-
 10 files changed, 14 insertions(+), 15 deletions(-)
2010-01-06 15:18:22 -03:00
Leandro Lucarella
072ac6c4e3 Merge DMD r301: a little refactor and harmonize
---
 dmd/declaration.h |    1 +
 dmd/func.c        |   30 ++++++++++++++++++++++++++++++
 dmd/mtype.c       |   51 +++++++++++++++++++++++++++++++++++++--------------
 3 files changed, 68 insertions(+), 14 deletions(-)
2010-01-06 15:18:21 -03:00
Leandro Lucarella
357dc9c1a9 Merge DMD r253: refactor: Argument => Parameter
---
 dmd/arrayop.c     |   30 ++++----
 dmd/arraytypes.h  |    2 +-
 dmd/class.c       |    8 +-
 dmd/declaration.c |   10 ++--
 dmd/declaration.h |   16 ++--
 dmd/doc.c         |   12 ++--
 dmd/dsymbol.c     |    4 +-
 dmd/expression.c  |   48 +++++++-------
 dmd/expression.h  |   32 +++++-----
 dmd/func.c        |   78 +++++++++++-----------
 dmd/init.c        |    2 +-
 dmd/interpret.c   |    8 +-
 dmd/mtype.c       |  190 ++++++++++++++++++++++++++--------------------------
 dmd/mtype.h       |   32 +++++-----
 dmd/opover.c      |   34 +++++-----
 dmd/parse.c       |   40 ++++++------
 dmd/parse.h       |    2 +-
 dmd/statement.c   |   90 +++++++++++++-------------
 dmd/statement.h   |   14 ++--
 dmd/struct.c      |    8 +-
 dmd/template.c    |   30 ++++----
 gen/functions.cpp |   10 ++--
 gen/functions.h   |    2 +-
 gen/tocall.cpp    |   10 ++--
 gen/typinf.cpp    |    6 +-
 25 files changed, 359 insertions(+), 359 deletions(-)
2010-01-06 15:18:20 -03:00
Leandro Lucarella
7d2c329195 Merge DMD r243: some harmonization with D2 dmd
---
 dmd/aggregate.h   |   24 ++++-
 dmd/attrib.c      |   63 ++++++----
 dmd/attrib.h      |   10 +-
 dmd/declaration.h |    5 +-
 dmd/func.c        |  337 ++++++++++++++++++++++-------------------------------
 dmd/mars.c        |    2 +-
 dmd/mars.h        |    7 +
 dmd/mtype.h       |   13 ++-
 dmd/parse.c       |   32 ++++-
 dmd/parse.h       |   14 ++-
 dmd/scope.h       |    2 +-
 11 files changed, 263 insertions(+), 246 deletions(-)
2010-01-06 15:18:19 -03:00
Christian Kamm
3479e91996 Merge DMD 1.051 2009-11-06 23:58:01 +01:00
Christian Kamm
72d1f1e6dd Make the auto storage class never have the same meaning as scope.
This changes the meaning of
auto class MyClass {} and
auto MyClass ident;
Both have been made an error to prevent accidents.
2009-07-12 16:15:21 +02:00
Christian Kamm
723cfef519 Another shot at fixing the issues with (constant) struct literals and their addresses. See DMD2682, #218, #324.
The idea is to separate the notion of const from 'this variable can always be
replaced with its initializer' in the frontend. To do that, I introduced
Declaration::isSameAsInitializer, which is overridden in VarDeclaration to
return false for constants that have a struct literal initializer.

So
{{{
const S s = S(5);
void foo() { auto ps = &s; }
// is no longer replaced by
void foo() { auto ps = &(S(5)); }
}}}

To make taking the address of a struct constant with a struct-initializer
outside of function scope possible, I made sure that AddrExp::optimize doesn't
try to run the argument's optimization with WANTinterpret - that'd again
replace the constant with a struct literal temporary.
2009-06-14 19:49:58 +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
e8780d50e8 Merged DMD 1.045 !!! 2009-05-16 22:21:31 +02:00
Christian Kamm
53c3ac0313 Fix overload resolution issue in dmd bug 313/314 fix. 2009-05-16 12:17:33 +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
3d1f8cc565 Merged DMD 1.042. 2009-04-03 17:59:34 +02: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
Tomas Lindquist Olsen
c42c90ea80 * Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
* Added #if IN_DMD versioning around DMD backend specific code in the D1 frontend, D2 is currently broken.
* All part of a greater cleanup scheme.
2009-03-26 20:45:53 +01:00
Tomas Lindquist Olsen
3ac45285fc Cleanup DMD 1.041 merge. 2009-03-23 20:26:33 +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
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
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
Tomas Lindquist Olsen
6716aecc52 Merged DMD 1.037 frontend 2008-12-13 13:15:31 +01:00
Tomas Lindquist Olsen
f46f865375 Removed KDevelop3 project files, CMake can generate them just fine!
Fixed function literals in static initializers.
Changed alignment of delegates from 2*PTRSIZE to just PTRSIZE.
Changed errors to go to stderr instead of stdout.
Fairly major rewriting of struct/union/class handling, STILL A BIT BUGGY !!!
2008-11-29 21:25:43 +01:00
Christian Kamm
16b38a7fef Fix compile-time warnings. Adjust include in d-asm-i386. 2008-11-03 12:35:29 +01:00
Tomas Lindquist Olsen
6cf5ca6aba Removed warnings on ignored aligns. Only do aligment on packed structs, align(1) struct Packed { ... }
Changed the way struct/class fields are added, first small part of cleaning up these...
Make struct/class/union fields aware of any anonymous struct/union they might be part of, not yet really useful, but part of getting better union support.
2008-10-28 15:41:09 +01:00
Tomas Lindquist Olsen
fdc172377e Fixed tuple fields, thanx downs 2008-10-27 01:11:41 +01:00
Tomas Lindquist Olsen
202c4f7bc2 Changed premake.lua to work with mingw.
Implemented array operations, not perfect but ok for tonight. closes #89
2008-10-13 23:19:32 +02:00
Christian Kamm
6eeeafdba6 First part of rename to LDC. 2008-10-06 22:46:55 +02:00
Christian Kamm
b3d4bc83f8 Move check for access of context for nested class from backend into frontend. 2008-10-02 23:12:19 +02:00
Tomas Lindquist Olsen
daad516579 Removed the 'needsstorage' thing from Dsymbol. Arguments are not always given storage when applicable. This is not longer treat specially
in this regard. Code for accessing nested variables and contexts rewritten. Probably more. Fairly well tested.
2008-08-04 02:59:34 +02:00