Commit graph

478 commits

Author SHA1 Message Date
Martin Kinkelin
c10cf86403 Add @naked UDA
Adding the LLVM `naked` function attribute and disabling LDC's
prologue/epilogue too.
2018-07-27 22:53:55 +02:00
Martin Kinkelin
c536910cb3 Bail out when trying to take address of intrinsic
Incl. overloaded aliases.
2018-06-26 23:10:13 +02:00
Ivan Butygin
cbeb2b45d6
@dynamicCompileEmit attribute (#2747) 2018-06-26 21:59:02 +03:00
Martin Kinkelin
a133ffad56 MSVC: Port Rainer's upstream extern(C++) method ABI fixes
From https://github.com/dlang/dmd/pull/8330.
2018-06-19 20:13:02 +02:00
Martin Kinkelin
3ca43c51b8
Use IndirectByvalRewrite for non-POD args and extern(C++) on Posix (#2728)
Fixing one aspect of issue #2702; not tackling the different destruction
rules yet.
2018-06-19 20:09:35 +02:00
Martin Kinkelin
29d609d63d Refactoring: Introduce TargetABI::reverseExplicitParams() 2018-05-30 22:42:00 +02:00
Martin Kinkelin
92913d4c08 Store front-end D function type in IrFuncTy
As we do for IrFuncTyArg. We'll need access to the front-end linkage for
the Posix ABIs too in order to implement indirect-by-value passing of
non-PODs for `extern(C++)`.
2018-05-30 22:41:48 +02:00
Martin
d8f60d2f5c Redirect access to object.d type declarations through gen/runtime
Not all type declarations yet (e.g., some TypeInfo subtypes are still
accessed directly), but those already wrapped as LazyType in the
gen/runtime.cpp module (with check and proper error msg in case object.d
doesn't contain a required declaration).
2018-04-04 19:59:10 +02:00
Martin
1b8a3b9d7d Adapt to frontend injecting implicit 'return 0' for betterC main
This fixes lit-test codegen/betterC_typeinfo.d.
2018-02-25 01:25:37 +01:00
Martin
c6132508b1 Don't waste an alloca for the nested context argument
And so get rid of all loads too; just use the untouched pointer argument
directly.
2018-02-11 18:43:02 +00:00
Johan Engelen
1da088330d
Add basic clang-like support for XRay, through -fxray-instrument and -fxray-instruction-threshold=. (#2465)
Currently only fully working on Linux.
See https://llvm.org/docs/XRay.html
2018-01-23 22:06:05 +01:00
Johan Engelen
3ec79179b4 PGO: refactor such that there can be IR-based and frontend-based PGO. 2018-01-15 23:59:14 +01:00
Johan Engelen
f2d9ff3424
Add DMD-style function trace profiling. (#2477) 2018-01-14 22:22:59 +01:00
Martin Kinkelin
11dfc4b5d7
Get rid of dead code (arrayops + DtoCallFunction() overload) (#2500) 2018-01-14 00:02:42 +01:00
Martin Kinkelin
ca6472c3b0
Don't eliminate frame pointer by default at -O0 (#2483)
Fixes issue #2480.
2018-01-13 13:49:10 +01:00
Martin
27deb2ff8c Get rid of obsolete gen/llvmcompat.h
Not needed anymore since C++11.
2018-01-12 20:20:47 +01:00
Martin
213de9b2f7 Merge branch 'master' into merge-2.077
Conflicts:
	runtime/druntime
2017-11-26 18:26:32 +01:00
Ivan
c839e9dfd0 Rename functions 2017-11-09 21:59:26 +03:00
Ivan
5426ffbd3d rename compiler files 2017-11-09 21:51:13 +03:00
Ivan
33c6cbb807 Renaming 2017-11-09 21:29:32 +03:00
Martin
ad89009d6e Merge 2.077.0 front-end and stdlibs 2017-11-05 18:41:55 +01:00
Ivan
044dd7bc9d Fix typo 2017-11-02 20:22:52 +03:00
Ivan
ae4db7d3b3 Merge remote-tracking branch 'origin/master' into runtime_compile_v5 2017-11-01 22:24:27 +03:00
Martin
183f97cd4e Objective-C: Fix functions with selector (issue #2387) 2017-10-26 17:01:02 +02:00
Ivan
7660affb15 small functions fix 2017-10-23 22:03:02 +03:00
Ivan
31861621eb Merge remote-tracking branch 'origin/master' into runtime_compile_v5 2017-10-23 21:53:27 +03:00
Martin
782190f8f4 Fix issue #2376
Stupidly warning about multiple definitions if a following one is in
fact just a forward-declaration.
2017-10-22 22:38:10 +02:00
Ivan
a6d788cdb5 Set "target-cpu" and "target-features" function attributes to jit host except when they are set explicitly by user 2017-10-19 19:06:04 +03:00
Ivan
dc78564bf4 Merge remote-tracking branch 'origin/master' into runtime_compile_v5 2017-10-14 12:28:32 +03:00
Martin
c251170912 Rename DtoMangled... to getIRMangled... 2017-10-07 14:06:17 +02:00
Martin
c9a3be1295 Let TargetABI fix up LLVM mangles for more special symbols
For ModuleInfos, ModuleRefs, InterfaceInfos, interface vtables & thunks.
2017-10-07 14:06:17 +02:00
Martin
0b28925e9a Win32: Remove extra leading underscore from D symbol mangling
This is compatible with DMD.
2017-10-07 14:06:17 +02:00
Martin
d7f68dbeb3 Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
2017-10-01 18:28:44 +02:00
Ivan
808f36b2d2 Merge remote-tracking branch 'origin/master' into runtime_compile_v5 2017-10-01 17:02:50 +03:00
Martin
610a1c37e4 Handle multiple function definitions with same mangled name
By discarding (and warning about) all but the first definition.
compilable/test17352.d tests that the compiler accepts 2 distinct but
equivalent templated function instantiations (with an alias to a
different local of the same type and name) ending up with a common
mangled name.
See https://issues.dlang.org/show_bug.cgi?id=17352.
2017-09-23 22:11:34 +02:00
Martin
1fa90a0381 Fix parameter-less out contracts of virtual methods with auto return type
These out contracts can still access the return value via __result.

LDC always passes the return value by reference to the out contract -
as long as there is a result (non-void). As the return type may still
need to be inferred in the first semantic pass, reserve a parameter
there and remove it later in semantic3() in case it is void (or finalize
its type).

Fixes compilable/test17502.
2017-09-23 21:50:34 +02:00
kinke
ae9d43c167 Use LLVM headers for shared codegen command-line options (#2148)
I.e., llvm/CodeGen/CommandFlags.h which in turn includes
llvm/MC/MCTargetOptionsCommandFlags.h.

This gets rid of a few duplicates on our side and includes about 35
(depending on LLVM version) new command-line options. LLVM provides a
helper function to set up the TargetOptions according to (most of) these
options.
Newer LLVM versions may add new options and we'll automatically inherit
them, including setting up the TargetOptions accordingly.

I did my best (TM) to remove a few unused/undesirable options and hide all
remaining new ones except for `-fp-contract`. The lists will need to be
tweaked from time to time.
2017-09-20 01:04:43 +02:00
Martin
41aae46b91 Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
2017-09-12 19:44:53 +02:00
Martin
8cc5ff6e79 Fix debuginfos for nested ref/out parameters (use llvm.dbg.declare)
llvm.dbg.value() apparently doesn't like GEP + deref, so use
llvm.dbg.declare() & GEP.
2017-09-09 22:02:14 +02:00
Martin
8a5984b7d3 Use llvm.dbg.value for all non-special refs & fix nested refs DI 2017-09-09 22:01:22 +02:00
Martin
7d4e9622a5 Fix DI storage for captured function parameters 2017-09-09 22:01:22 +02:00
Ivan
0ef4edb0fb Some unused code cleanup 2017-08-27 17:42:56 +03:00
Ivan
42f283c221 D dynamic compilation support 2017-08-27 17:42:55 +03:00
Martin
b085be1404 Merge branch 'master' into merge-2.075
Conflicts:
	runtime/druntime
	runtime/phobos
2017-08-12 18:21:21 +02:00
kinke
b01c3be575 Replace hacky disabling of fp-elimination for functions with inline asm (#2266)
... by proper function attributes. Clang sets these 2 attributes if frame
pointer elimination is to be fully disabled.
2017-08-12 14:14:13 +02:00
Johan Engelen
ec9ffe29f1 Add the -fsanitize-blacklist option for the sanitizers. (#2261)
Blacklisting is necessary for some druntime functions, and LLVM/Clang already provides just the right functionality.
2017-08-09 23:21:33 +02:00
Martin
2616261fd2 Revise all LDC-specific errors/warnings/deprecs and insert backticks
For DMD's new syntax highlighting. I grepped in all .{h,cpp} files only.
2017-08-03 22:53:49 +02:00
Martin
c51c2c0d55 Merge 2.075.0 front-end and stdlibs 2017-07-30 03:03:28 +02:00
Martin
1fb269f940 Drop support for LLVM < 3.7 2017-07-16 02:18:00 +02:00
Nicholas Wilson
c041205fe0 Dcompute fixes (#2195)
* Disable debug info for now Until I get it working.

* Don't recurse into uninstansiated templates

* Remove device only modules from objfiles.

* Remove typeid generation for dcompute.

* Dont generate typeinfo member functions

* Whitelist `__dcompute_reflect`
2017-07-13 11:28:09 +08:00