1837 Commits

Author SHA1 Message Date
Kai Nacke
49599f71e9 Add sanitizer attributes.
If the sanitizer is enabled (e.g. -sanitize=address) then the corresponding
attribute (e.g. llvm::Attribute::SanitizerAddress) must be set.
2014-01-19 13:03:37 +01:00
Kai Nacke
ea9c996dcd Fix new signature of verifyModule() in LLVM 3.5. 2014-01-19 12:36:42 +01:00
Kai Nacke
a39e5582e6 DLL linkage is decoupled from linkage in LLVM 3.5. 2014-01-19 11:02:27 +01:00
Kai Nacke
87afa717ae Fix more files for LLVM 3.5. 2014-01-13 18:16:22 +01:00
Kai Nacke
c14e065138 Fix the LLVM 3.5 build.
Some classes were moved into IR folder.
2014-01-13 17:08:43 +01:00
Kai Nacke
b4b71e6c79 Fix include for LLVM 3.5 2014-01-12 11:37:52 +01:00
Kai Nacke
52a17c3a34 Fix build with LLVM 3.5 2014-01-11 17:25:59 +01:00
Jernej Krempuš
7436d94e09 Fixed a bug in DtoInlineIR
Before this fix, debug info was removed from the module while
parsing inline ir.
2014-01-06 01:27:26 +01:00
Kai Nacke
9b4a70c367 Use caching in DtoVaFunctionType.
Remove now unused method IrFuncTy.reset().
2014-01-03 15:14:39 +01:00
Kai Nacke
551bce6d18 Change location of assign to irFty.
If the comment about this function is still right (can be called recursively) then the assignment
to irFty should be done after all functions are called.
Takes advantage of move assignment, too.
2014-01-03 13:14:12 +01:00
Kai Nacke
1619b18f73 Small cleanup of attribute mess. 2013-12-31 17:29:25 +01:00
Kai Nacke
5139008207 Add missing forward declations to gen/utils.h 2013-12-31 16:43:54 +01:00
David Nadlinger
467651fc49 Merge pull request #559 from klickverbot/disable-internalizing-nested-functions
Disable internalizing of nested functions.
2013-12-26 06:27:39 -08:00
David Nadlinger
333d538a23 Handle differing LLVM types for AA literals.
This unsfortunately more or less duplicates the code we have for
emitting ArrayLiteralExps, but with the different iteration
strategies, having a single implementation would wind up
even messier.

Unfortunately, no regression test case yet, as I found this deep
inside vibe.d.
2013-12-26 13:39:59 +01:00
David Nadlinger
be185263ba Disable internalizing of nested functions.
This works around linking problems such as rejectedsoftware/vibe.d#338,
caused by the frontend appending template instances to the wrong
module.

GitHub: Fixes #558.
2013-12-26 13:24:41 +01:00
David Nadlinger
27ecc11915 Remove unused prototype. 2013-12-26 07:05:21 +01:00
Kai Nacke
acb1bb161a Fix a problem with the new array bounds check code. 2013-12-19 20:35:54 +01:00
Kai Nacke
5f520fccf9 Cache result of DtoFunctionType. 2013-12-19 19:45:16 +01:00
Kai Nacke
74630ed7f1 Simplify LLVM passes.
Use a typedef to minimize difference between LLVM 3.1 and Â3.2+.
Use IRBuilder method CreateMemCpy.
2013-12-16 15:00:00 +01:00
Kai Nacke
bac536a29c Fix for issue #553.
Check if a static array is accessed with a known index. In this case the
bounds check can be omitted.
2013-12-16 08:14:58 +01:00
Kai Nacke
aeba90b9f9 Fix a clang warning 2013-12-08 18:59:17 +01:00
Kai Nacke
43acc1f9c8 Check if basic types are read from object.di before usage.
If object.di was not read or is incomplete then basic types may be missing.
This results in a crash if they are used during runtime initialization.
This fixes #551.
2013-12-08 17:30:02 +01:00
Kai Nacke
76199638c1 Fix null pointer derefence in LLVM 3.5 2013-12-05 08:40:04 +01:00
Kai Nacke
37ee9962fd Changes for LLVM 3.5 2013-11-27 22:44:49 +01:00
Kai Nacke
7f017608a8 Use enum literal instead of constant 2013-11-26 07:56:50 +01:00
Kai Nacke
2063b4ea89 Fix for issue #543.
Immutables are constant values, too.
2013-11-14 21:21:04 +01:00
kai
e6529cfd3d [experimental] Add sanitizer options to LDC.
Add some of the sanitizer passes to LDC. This is not complete (linking must be
done using clang and the right `-fsanitize=` option) and may not be useful at
all.

If it proves to be usefull then a lot of other options (e.g. blacklist) must be
added.
2013-11-05 13:03:52 +01:00
kai
6fe28e1660 Small code modifications to Ir-Classes.
Adds some constructors and moves the code to the header file. Uses some of the new constructors.

A big problem with the source are the different strategies used for otherwise similar classes.
E.g. a IrField registers itself with the VarDeclaration. Same is required for IrParameter, but
in this case it is done by the caller.
2013-11-05 10:31:14 +01:00
kai
8d7f0bf0eb Fix for issue #535.
The symbols must have weak_odr linkage if they result from a template instantiation.
2013-11-04 02:21:05 +01:00
kai
8408afcf6d Add SSE4.1, SSE4.2, AES and SHA opcodes.
Also adds comments for all AVX opcodes supported by DMD.
This fixes issue #514.
2013-10-29 17:31:43 +01:00
David Nadlinger
9f1c26b52a gc2stack: Handle _d_allocmemory.
This allows us to clean up after inlining closures.
2013-10-27 17:05:19 +01:00
David Nadlinger
3539e201f8 gc2stack: Move TypeInfo handling code into FunctionInfo subclass.
This is to properly support calls that don't involve TypeInfo
at all, like it is already the case for _d_newclass, and will be
for _d_allocmemory.
2013-10-27 17:05:19 +01:00
David Nadlinger
5b9208ef85 gc2stack: Extract static size checking code into helper function. 2013-10-27 17:05:19 +01:00
David Nadlinger
e1a6d8144b gc2stack: Replace return type bool with proper enum flag.
This makes the code much easier to read.
2013-10-27 15:43:12 +01:00
David Nadlinger
27b4f730aa gc2stack: Remove unused safeToDelete mechanism. 2013-10-27 15:36:14 +01:00
kai
a73e4602ee Simplify EmitMemSet in GarbageCollect2Stack.
Simply take advantage of the predefined `CreateMemSet()` function.
2013-10-25 23:28:29 +02:00
kai
835e972e6b Fix va_arg handling.
The change of symbol emission ignored the fact that the va_arg intrinsic must be
handled in a special way. This commit corrects the omission (which leads to seg
faults on Linux/PPC64).
2013-10-25 16:15:52 +02:00
Kai Nacke
e5fe110280 Merge pull request #526 from klickverbot/newclass-signature
Correct signature of _d_newclass runtime call.
2013-10-23 21:43:11 -07:00
David Nadlinger
b052b30442 Correct signature of _d_newclass runtime call.
Fixes programs trying to directly access it (e.g. the
GtkD bindings). Not sure why this didn't come up earlier.
2013-10-24 00:27:09 +02:00
David Nadlinger
1f59740524 _d_allocclass -> "_d_newclass".
The define is a leftover from the times when we supported
both D1 and D2.
2013-10-24 00:25:36 +02:00
David Nadlinger
3d8e2e5e5c Add virtual destructor to GarbageCollect2Stack to silence GCC warning. 2013-10-24 00:24:55 +02:00
David Nadlinger
36b70b68e8 Do not generate invalid IR in dgc2stack pass.
Branching to a block that starts with a landing pad
instruction is illegal.

GitHub: Fixes #524.
2013-10-23 22:53:18 +02:00
David Nadlinger
7ca329e77e More accurate description for "-vv".
Still not happy with it, but I feel it is still better
than just "very verbose".
2013-10-15 01:50:44 +02:00
Kai Nacke
90d0f6c12a Merge pull request #429 from redstar/moduleflags
Implement pragma(lib) on Windows using module metadata.
2013-10-14 00:26:17 -07:00
David Nadlinger
f80be41713 Merge pull request #511 from klickverbot/issue-470
Gracefully handle struct decl/type mismatch when generating TypeInfo.
2013-10-13 18:24:21 -07:00
David Nadlinger
07e8fe4908 Gracefully handle struct decl/type mismatch when generating TypeInfo.
The type should have already been resolved if the struct
itself is, but due to multiple-types-per-declaration issues
in DMD, this might not be the case.

GitHub: Fixes #470.
2013-10-13 21:58:41 +02:00
David Nadlinger
265d3ee069 Do not try to emit nested functions with unanalyzed parents.
GitHub: Fixes #497.
2013-10-13 21:37:53 +02:00
kai
4f7bc678fb Implement pragma(lib) using module metadata.
Since LLVM 3.3 pragma(lib) can be implemented like DMD does.
2013-10-13 20:35:34 +02:00
David Nadlinger
60f385b062 Use IRState parameter instead of gIR where available. 2013-10-13 19:47:41 +02:00
David Nadlinger
1242be25d0 Remove unused, empty Ir type.
The codegen parameter was changed to IRState instead of
removing it to set the stage for an eventual eradication
of the gIR global.
2013-10-13 19:44:29 +02:00