This fixes issue #958 by checking the function type of an existing
function declaration with the same runtime function name inside the
codegen'd module.
This should normally be an existing forward declaration from a previous
runtime call, but the user is free to declare (and even implement) it
too.
The LOC for the error is empty as the provided `loc` may likely be from
a template instantiation from another module.
Windows x64 ABI: remove unnecessary \01 from mangled symbol name.
This removes the 0x1 byte from `.mangleof` accessible from user code.
Resolves issue #1519
Also let mangleForLLVM take a std::string, to enable C++11's moves.
These functions are only called at most once: in case of a failure.
They always raise an exception and never return normally. Marking
them as 'cold' and 'noreturn' may help the (not yet added) IRCE pass.
Also adds the missing 'uwtable' attribute for x86_64 and clang-format
the file.
Also adds the CMake infrastructure to compile and link the D source files.
The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals
The added overhead for Windows et al. is utterly insignificant
compared to all the other typically unused declarations that
will be created by this, and copy/pasting the long condition
(see d072bdf) is error-prone. The alternative would have been
to factor the check out into a predicate function.
This PR replaces the few uses of global.params.is<OS> with
global.params.targetTriple.isOS<OS>(). This avoids adding a new
boolean for each supported OS.
It also defines all xBSD-type OS as using the dso-registry.
Now we no longer require separate landing pads for collisions
in user code. This leads to less cruft being generated and opens
the door towards folding the successful and exceptional paths
through finally blocks into one.
This commit breaks Win64; ldc.deh2 will also need updating.
0.15.1 used stdcall convention everywhere. But the ABI change in 0.15.2
requires use of the C calling convention for variadic calls on x86
because the stdcall convention does not support vararg functions.
Solution is to check the llvm::FunctionType if the function has varargs.
This commit also makes the C calling convention the global default
because according to the LLVM documentation the fastcc convention used
for D linkage does not support varargs.
This fixes issue #1000.
_d_newarraymT and _d_newarraymiT are now named _d_newarraymTX and
_d_newarraymiTX. There is also a change in the signature: instead
of a variable length argumentlist the functions now require an array
of dimensions.
This should fix test runnable/test28.d
This is required for the GC to be able to call their dtors, if need
be (by appending a TypeInfo pointer after the actual struct in case
the struct has a dtor).
_d_newitemT() / _d_newitemiT() also perform the initialization, so
we don't need to take care of that in toir.cpp anymore.