248 Commits

Author SHA1 Message Date
kai
820f6dbc7c Fix deprecation messages for non-vendor pragmas.
The deprecation message for non-vendor pragmas was never shown.
2013-02-28 08:00:43 +01:00
kai
a7bed6c488 Fix prototypes from DMD2.
The prototypes for obj_includelib and obj_startaddress are DMD-specific.
Update them to match DMD 2.061.
2013-02-28 07:58:28 +01:00
kai
5c6ba2ec3b Add missing pragma and deprecation warning.
The LDC_allow_inline pragma is not recognized. The deprecation message for
non-vendor pragmas is missing.
2013-02-28 06:58:45 +01:00
David Nadlinger
6dc122b424 MinGW: Use __mingw_strtold instead of strtold.
The latter fails to parse hex floating point literals.
2013-02-26 13:14:32 +01:00
David Nadlinger
f417500abc MinGW compilation fixes. 2013-02-13 00:07:53 +01:00
David Nadlinger
ad53d9e558 MinGW support in Port. 2013-02-13 00:07:50 +01:00
David Nadlinger
5616753768 Consistently use quotes for LLVM includes. 2013-02-07 21:20:54 +01:00
David Nadlinger
d4b391249d Removed redundant global.params.os field.
I hope I have untangled the checks for "native" Windows (Triple::Win32)
vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly.

MinGW needs some default libraries as well, has to be fixed later.
2013-02-07 21:20:54 +01:00
David Nadlinger
5f3ba41574 Removed redundant global.params.cpu field.
Now that we have global.params.targetTriple, the information
is only duplicated.
2013-02-07 17:36:54 +01:00
David Nadlinger
bee0b9eba1 Remove global.params.isLE. 2013-02-07 14:37:21 +01:00
kai
104cd77e9c Merge branch 'master' into merge-2.061-2 2013-02-03 15:50:39 +01:00
kai
0ff8d2f9f1 Fix a compile error with LLBM 3.3 2013-02-03 12:29:32 +01:00
kai
cb22044f58 Merge branch 'master' into merge-2.061-2
Conflicts:
	dmd2/interpret.c
2013-01-21 18:06:13 +01:00
kai
55560bf382 Make frontend endian-aware.
In many parts the DMD frontend assumes a little endian CPU. In some
parts there are checks for endianess but they are incomplete and the
used definition is wrong. (Test for endianess will be removed in dmd
2.062.)
In this commit I add the required #if's and also add a CMake test for
endianess because there is no single compiler definition to check for.
2013-01-21 08:41:21 +01:00
David Nadlinger
30caa4bfe6 Merge branch 'master' into merge-2.061-2 2013-01-12 01:27:02 +01:00
David Nadlinger
b99b78558b Hack to make nested struct .init results an rvalue.
The code still needs closer scrunity, as the 'nested' test
from the DMD testsuite doesn't fully pass yet.
2013-01-11 21:34:45 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
86a6a6ba05 Use DMD's C++ name mangling functionality.
Likely wrong for MinGW/MSVC.

Fixes DMD testcase 'test7030'.
2013-01-04 06:22:57 +01:00
David Nadlinger
eb56e934a5 Restore original Parameter::ForeachDg signature.
Having two functions is not pretty, but shorter than messing
around with a custom context object, and much, MUCH better than
requiring a lot of changes to the rest of the code base.
2013-01-04 06:22:57 +01:00
David Nadlinger
26217eabb2 Remove LDC-specific callable literal kind inference hack. 2013-01-04 06:22:57 +01:00
David Nadlinger
5c518a16ec Merged 2.061 frontend. 2013-01-04 06:22:53 +01:00
David Nadlinger
326aedd0e4 Align AlignDeclaration constructor signature to upstream version.
If there still are error messages benefiting from the added
location information, the change should be upstreamed, as usual.
2013-01-04 01:50:51 +01:00
David Nadlinger
39e3e3a678 Replace template symbol module fix with more localized hack.
This reverts commit c4adbedcc, which would have fixed the
problem at its roots, but caused strange template function
attribute inference failures in D-YAML, presumably due to
the different order of semantic3 execution on the templates.
2012-12-31 05:46:29 +01:00
David Nadlinger
c4adbedcc6 Emit template symbols into correct module during many-at-once compilation.
Previously, it could happen that regular symbols referenced
only as part of a template instance (e.g. a lambda passed as
an alias parameter) were not even emitted in the wrong module,
but not at all because mustDefineSymbol would return false to
them when being analyzed during codegen of the wrong module.

This issue might affect incremental compilation with DMD as
well, and the fix should be discussed with the upstream devs.

GitHub: Fixes #249.
2012-12-30 02:37: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
0cd78dd579 Cleanup: Clang warning fixes.
No warnings left on a '-Wall' build except for a single tautological
compare in gen/asm-x86-32.h, which indeed seems like a bug.
2012-12-20 01:00:55 +01:00
David Nadlinger
2988bc46e0 Removed long obsolete (and broken) LLVM IR annotation code.
If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
2012-12-19 01:50:48 +01:00
kai
c250b8b208 Remove virtual keyword not present in DMD source.
The virtual keyword is not required when overriding a virtual method.
This commit sync the LDC source with DMD source.
2012-12-18 23:10:30 +01:00
kai
d4521c15c6 Wrap LDC specific code in #ifdef INLLVM / #endif 2012-12-18 18:12:11 +01:00
kai
393d142a78 Revert "Wrap LDC specific code in #ifdef IN_LLVM/#endif"
This reverts commit d92a1842b1.
2012-12-17 09:35:29 +01:00
kai
d92a1842b1 Wrap LDC specific code in #ifdef IN_LLVM/#endif 2012-12-17 00:12:06 +01:00
kai
ca2cc75567 Mark LDC changes and remove unused debug? switches.
The Param struct is very different between DMD and LDC. This is a start
to mark the differences. This also includes identifying unused switches
- like the debug? switches.
2012-12-17 00:08:46 +01:00
kai
6de735e578 Whitespace fixes 2012-12-17 00:08:06 +01:00
David Nadlinger
b713afe9c4 Cleaned up version output.
I removed the copyright notice. I don't think we are obliged to
display it for DMD; on the other hand, if we do, we might also
have to display the libconfig one (LGPL). Thus, this seemed like
the better choice.

The indentation is to align with the registered target output,
which we cannot control.
2012-12-16 18:08:19 +01:00
David Nadlinger
4512201de5 Removed obsolete IrSymbol class. 2012-12-16 17:19:14 +01:00
David Nadlinger
cbc7028e50 Added vendor-prefixed pragma names, deprecated old ones. 2012-12-08 21:38:54 +01:00
David Nadlinger
8e13d109ce Removed unused va_intrinsic pragma identifier. 2012-12-08 21:38:54 +01:00
David Nadlinger
dfa1bd954d Removed {insert, extract}element and shufflevector pragmas.
They have been superseeded by the inline IR pragma and ldc.simd,
and have only been around for a short time (and not in any
released version).
2012-12-08 21:38:54 +01:00
kai
ccde570520 Fixed a compiler error with MSVC.
Maybe caused by recent changes to `expression.c`.
2012-11-18 13:37:55 +01:00
David Nadlinger
60ebf5b968 Fix building against the OS X 10.8 SDK.
This is a backport of DMD commit 47bee50a39 by Justin Holewinski.

GitHub: Fixes #218.
2012-11-17 22:29:23 +01:00
Jernej Krempuš
7bbe782615 Pragma llvm_inline_ir
Adding pragma llvm_inline_ir.

Improved the error messages.

Append "ret void" when the return type is void

Improved the error message

in case when the string passed as llvm inline ir isn't valid llvm
assembly language.

LLVM 3.2 fix.

Add attribute AlwaysInline inside DtoInlineIRFunction.

Always generate a body for llvm_inline_ir

Also, always make llvm_inline_ir functions linkonce_odr. Because
the body is always generated when a module uses a llvm_inline_ir
function, the fact that the linker removes the function shouldn't
cause problems.
2012-11-08 22:05:15 +01:00
David Nadlinger
d523be3010 Added explanation for commit 9b80037.
Such uncommented changes to the frontend are potentially a huge
source of confusion during merging new frontend versions
(especially if the piece of code gets changed again before the
next upstream release).
2012-10-13 18:20:56 +02:00
David Nadlinger
a9e151ee1f Mitigate a nested unions crash/wrong code bug.
This fixes the std.format unit tests for assertion-enabled
LLVM builds.

What the actual solution for the problem should be depends
entirely on the outcome of the "Nested Unions?" discussion
on dmd-internals.
2012-10-13 18:15:13 +02:00
kai
9b80037f56 fix Issue 8675 - Nothrow can't throw Errors
- fixed by checking whether the thrown exception is derived
  from Error before complaining about uncaught throws
2012-10-09 06:43:20 +02:00
David Nadlinger
8118c846af Fixed unlisted contract parameter issue.
Thanks to alexrp for mentioning it.
2012-10-07 14:58:01 +02:00
David Nadlinger
579c522e52 Fix GitHhub #180 – "#ifdef defined(...)". 2012-10-05 17:07:21 +02:00
Jernej Krempuš
b798974f3a Added pragma insertelement. 2012-10-02 22:22:53 +02:00
Jernej Krempuš
2cf5d8c2a0 Added pragma extractelement 2012-10-02 21:37:27 +02:00
David Nadlinger
c6abdcf4a4 Don't set TypePointer::isunsigned to true in the frontend.
The previous solution was problematic because the change was language-
visble via the isUnsigned trait. Now, pointers are simply explicitly
checked for in the relevant places. (Note that there might be cases in
the diff where a direct isunsigned() call would have been appropriate –
I only checked for instances where the type clearly cannot be a pointer,
but chose to go the safe route in replicating existing behavior
otherwise).

Fixes DMD testcase 'traits'.
2012-09-28 00:28:49 +02:00
David Nadlinger
25beaf41b5 Fix base class contract invocation.
Fixes DMD testcase 'testcontracts'.
2012-09-27 21:05:51 +02:00