Commit Graph
21 Commits
Author SHA1 Message Date
kai 1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +01:00
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 4ec9fbc011 Small cleanup of gen/pragma.cpp
- Added locations to many error messages
- Fixed indentation
2013-02-25 20:32:35 +01:00
David Nadlinger 0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +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 9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger 94bd923e96 Fixed pragma(LDC_verbose). 2012-12-08 21:41:22 +01:00
David Nadlinger cbc7028e50 Added vendor-prefixed pragma names, deprecated old ones. 2012-12-08 21:38:54 +01:00
David Nadlinger a39a136e14 Line breaks, slight cleanup. 2012-12-08 21:38:54 +01:00
David Nadlinger f79b998e87 Whitespace cleanup. 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
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š fd3e79b7bb Corrections. 2012-10-03 15:26:43 +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
kai 2e47e98c2c Fix access violation.
Variable `args` was used without first checking for valid values. You could crash LDC by entering something like 'pragma(intrinsic) void crash();' in the source file.
2012-09-15 16:15:02 +02:00
Jernej Krempuš 100907ffa2 Added pragma shufflevector. 2012-08-06 20:50:33 +02:00
kai 2dbee75523 Prefer C++-style casts.
This is based on Item 2 of "More Effective C++". In general, the C++ cast operators are more expressive and easy to find,
e.g. by grep. Using const_cast also shuts up some compiler warnings.
2012-08-02 19:55:29 +02:00
Alexey Prokhin bca73ec8b9 Merged dmd 2.059beta 2012-04-05 15:30:00 +04:00
Alexey Prokhin f237d85af0 Implemented bt/btc/btr/bts intrinsics 2012-02-15 13:16:34 +04: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