Commit Graph

549 Commits

Author SHA1 Message Date
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
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
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
David Nadlinger
288fd47707 Merged 1.075 frontend. 2012-11-24 21:10:13 +01:00
kai
dcff6c92c7 Conditionally add error() prototype and remove inifile().
This is alyready done in `dmd2/mars.h`.
2012-11-18 18:04:35 +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
David Nadlinger
34e1415f35 Merge pull request #226 from jerro/pragma-llvm-inline-ir
Pragma llvm_inline_ir
2012-11-15 12:05:17 -08:00
David Nadlinger
ab94a6d60c Don't treat __ensure specially in LDC.
The only change here is commenting out the Id::ensure check,
the rest is just alignment of the code to upstream DMD.
2012-11-08 23:53:50 +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
Jernej Krempuš
047dcb5591 Fixed D1 build errors. 2012-10-03 04:13:21 +02:00
David Nadlinger
165e0ef3c6 Fix typo in D1 part of 940d6e9. 2012-09-16 22:07:30 +02:00
David Nadlinger
b11c49a9c9 Fix D1 build.
This applies the changes from 9a3cdf2e to dmd/ as well.
2012-09-16 22:04:39 +02:00
kai
940d6e907f Take advantage of Triple and TargetData.
A lot of system specific knowledge is already present in LLVM. This is used to populate several fields in global.params instead of hard coded values in main(). Ensures that the frontend and LLVM have always the same values.
2012-09-16 19:50:21 +02:00
kai
4b0c4bf4ae Get rid of global.params.dataLayout.
The string representation of the data layout is retrieved from the TargetData class (in main) and passed via global.params.dataLayout to the module. Since the gTargetData is also a global variable it makes no sense to pass this information using another global variable.
2012-09-08 20:25:42 +02:00
kai
4ae64dd2e7 Fix size returned by os_critsecsize() and construct type for D_CRITIAL_SECTION on Windows. 2012-09-08 11:49:37 +02:00
kai
2173b52aea Make LDC1 compile with LLVM 3.2 trunk. 2012-08-17 15:44:20 +02:00
kai
692d624db4 Make LDC1 compile again. 2012-08-17 15:34:17 +02:00
kai
e6a07ffdfe Several changes to optimizer related code.
- New functions codeGenOptLevel() and verifyModule() to remove code duplication
- Hidden option no-verify renamed to disable-verify and moved to optimizer (like opt tool)
- Removed global.params.noVerify
2012-08-16 23:26:52 +02:00
kai
e13b115583 More unification work. 2012-07-29 14:22:56 +02:00
kai
175810bdab Consolidate all MSVC related files for LDC/LDC2 in 1 folder. 2012-06-06 17:32:47 +02:00
kai
086e0d251b Latest changes to compile LDC with MSVC. 2012-06-06 17:29:21 +02:00
kai
30cc6e309a Add more files required for MSVC. 2012-06-01 17:49:28 +02:00
David Nadlinger
1805e534b2 Fix issue 97 - <<= broken for LDC 1.
This code path was introduced in the 1.074 merge.
2012-05-25 15:54:42 +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
Eldar Insafutdinov
30b20794c7 Fix D1 frontend 2012-04-02 16:43:46 +01: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
0a9ba4d283 Move additional #include inside IN_LLVM section. 2012-03-25 15:19:25 +02:00
kai
2433b74460 Add some upcoming changes from 2.059/1.074 which helps compiling with MSC. 2012-03-22 21:01:43 +01:00
kai
dee054fae0 Small code cleanup.
- Wraps some LDC specific code in 'IN_LLVM' section
- Adds some MSVC specific code to 'IN_LLVM' section
- Removes an unused include file

Net result is much less errors with MSVC.
2012-03-15 07:11:54 +01:00
kai
d6396bbddf Fix error with va_arg in 64 bit mode. 2012-03-06 07:29:43 +01: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
Alexey Prokhin
4d3ba3594c Refactoring: moved ldc specific code from dmd/attrib.c and dmd2/attrib.c into gen/pragma.cpp 2012-02-15 13:16:06 +04:00
kai
04b3d72cfe Fix for issue #60. 2012-02-03 17:20:18 +01:00
kai
37ed7cdbae Added missing initialization. 2012-02-03 16:51:11 +01:00
kai
f9201e8352 Merge 1.072 2012-02-02 03:13:27 +01:00
David Nadlinger
efcbe8390a Work around macro redefinition warning (darwin11-llvm-gcc-4.2). 2012-01-23 21:42:02 +01:00
Alexey Prokhin
43057c64ec Temporary fixes for #60 and #59 until ldc1 frontend is not updated to the latest version 2012-01-10 22:09:22 +04:00
Alexey Prokhin
43365105ef Forgotten changes from 875ebcf 2012-01-10 21:46:40 +04:00