Commit graph

660 commits

Author SHA1 Message Date
Johan Engelen
3ceccd9dc1 Ensure strict evaluation order in slice expressions. Fixes a testsuite bug that only manifests itself for 32bit compilation. 2016-03-24 19:42:35 +01:00
Johan Engelen
32e159ff47 Ensure strict evaluation order in slice expressions. Fixes a testsuite bug that only manifests itself for 32bit compilation. 2016-03-24 19:36:44 +01:00
Kai Nacke
dccbe96c00 Merge branch 'master' into merge-2.070 2016-02-23 06:57:30 +01:00
Kai Nacke
2d82dae628 Merge branch 'master' into merge-2.069 2016-02-23 06:41:11 +01:00
David Nadlinger
127381f234 package methods are always final
GitHub: Fixes #1308.
2016-02-21 15:48:11 +01:00
David Nadlinger
90c213b52e Adapt to changed StringExp API
Not tested yet. There is also quite a bit of potential for
further cleanup of the glue layer string manipulation code.
2016-02-14 19:35:40 +01:00
Johan Engelen
e81a40b465 Fix union initialization. Fixes issue 1286. 2016-02-11 15:41:12 +01:00
Johan Engelen
3aec5f8a70 Fix union initialization. Fixes issue 1286. 2016-02-11 15:33:23 +01:00
David Nadlinger
03429eb60f gen: Fix another array literal crash with vectors 2016-02-06 20:57:07 +01:00
David Nadlinger
97ca35acad ToElemVisitor: AssignExp::memset semantics have changed 2016-02-04 01:00:42 +01:00
Johan Engelen
29ce4012af dmd2 --> ddmd. Merge (almost all of) our changes to dmd source into the new D source of dmd 2.069.2.
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
2016-01-28 19:03:58 +01:00
Martin
956061c3c7 Revise DtoGEP() helpers and mark most GEPs inbounds 2015-12-14 00:18:15 +01:00
Martin
ddfaac10b3 Rename DtoAggrCopy/ZeroInit() to DtoMemCpy/SetZero() overloads
And replace some obvious load->store combos by a memcpy.
2015-12-04 22:23:09 +01:00
Martin
740a21eb8f Rename DtoIsPassedByRef() to DtoIsInMemoryOnly()
Motivation: issue #937
2015-12-04 22:23:09 +01:00
Johan Engelen
70a6e73188 Cleanup runtime fwd decls and use ABI functiontype rewriting 2015-11-22 01:27:26 +01:00
David Nadlinger
db3b3f157f Remove unused get_default_initializer argument 2015-11-06 00:24:03 +02:00
Martin
2dfa5e8569 Some more cosmetic fixes
Found by searching for lines > 80 chars.
2015-11-05 19:12:32 +01:00
David Nadlinger
59cb0e5d8f gen: Fix Visitor override/shadowing warnings 2015-11-02 11:30:40 +02:00
David Nadlinger
05d45350aa clang-tidy: Add readability-else-after-return 2015-11-02 11:30:40 +02:00
David Nadlinger
9df487edff gen/ir: clang-tidy the world 2015-11-02 11:30:40 +02:00
David Nadlinger
44b0f7b615 driver/gen/ir: clang-format the world
This uses the LLVM style, which makes sense for sharing code
with other LLVM projects. The DMD code we use will soon all
be in D anyway.
2015-11-02 00:28:01 +02:00
Martin
2d959ea540 Make use of C++11 range-based for
Should be available now that support for LLVM < 3.5 has been dropped.
2015-11-01 14:49:04 +01:00
Martin
b63a5e3cf8 Merge branch 'master' into merge-2.068 2015-10-22 22:39:46 +02:00
Martin
05c10d9107 Introduce DtoAlignment() and overload DtoAlloca() for VarDeclarations
Trying to get the alignment right by using the first non-default one
in the following order of descending priority:

VarDeclaration::alignment [variables only of course]
Type::alignment()
Type::alignsize()

This fixes `align(x) struct S { ... }`.
2015-10-18 14:38:09 +02:00
Kai Nacke
012a9ee05c Merge branch 'master' into merge-2.068 2015-10-10 17:49:03 +02:00
David Nadlinger
0fe7180e2c Fix AssertExp in boolean context also for release builds 2015-10-09 22:21:40 +02:00
Martin
cda8a12112 Merge branch 'master' into merge-2.068
Conflicts:
	dmd2/root/man.c
	tests/d2/dmd-testsuite
2015-10-05 22:56:36 +02:00
Martin
b8daa46197 Fix typo in comment 2015-10-04 00:13:53 +02:00
Martin
b13565c17e Refactor common i1ToI8(voidToI8(DtoType(...))) code occurrences 2015-10-03 22:58:00 +02:00
Martin
c2e699f2c3 Watch out for special case when initializing ref variables
It may be the initialization of the variable's hidden pointer,
or the initialization of the pointee.

This fixes bugzilla 14944 for us (tested in `runnable/sctor.d`),
see https://github.com/D-Programming-Language/dmd/pull/5013.
2015-10-03 15:19:47 +02:00
David Nadlinger
86a1d8adf2 Do not unconditionally call toElemDtor in CondExp codegen
Since DMD commit 3bbe72b5f, the dtors are now rewritten in the
frontend.
2015-09-26 15:24:36 +02:00
David Nadlinger
ce66fa4866 Emit error on invalid nested function call instead of crashing
For fail_compilation/fail39.d, the frontend furthermore passes a
FuncExp with a TOKdelegate declaration, but a function pointer type
to the glue layer. Just add that to the special case list.
2015-09-26 15:24:36 +02:00
Martin
d45170464e Merge branch 'master' into merge-2.068
Conflicts:
	runtime/druntime
2015-09-26 14:21:43 +02:00
Martin
9e194bfe2c Refactor store-to-new-alloca code occurrences. 2015-09-25 17:12:42 +02:00
Martin
a721b4f823 Revise DtoRawAlloca() alignments 2015-09-25 15:16:28 +02:00
David Nadlinger
bd47ea49e6 Merge branch 'master' into merge-2.068 2015-09-24 17:57:25 +02:00
David Nadlinger
f4f55abf27 Use thunks instead of calling _d_toObject for D interfaces
This allows us avoid the problems stemming from the 64 kiB
size limit hack in _d_toObject.

GitHub: Fix #1065.
2015-09-13 20:27:00 +02:00
David Nadlinger
af47d7f944 Do not call postblit when initializing StructLiteralExp from rvalues
dmd-testsuite: Fixes runnable/nested.
2015-08-29 16:28:05 +02:00
David Nadlinger
830bd82afd Respect CallExp::directcall
Unfortunately, this is another case where the frontend breaks
the AST in such a way that you need to handle a condition in
exactly the place DMD does, because you cannot reconstruct the
information elsewhere.
2015-08-29 03:09:18 +02:00
David Nadlinger
3dccaad697 Fix "... && assert(0)" crash 2015-08-29 03:09:17 +02:00
David Nadlinger
cb0cecb9e7 Implement ToElemVisitor::visit(TypeidExp*) 2015-08-29 03:09:17 +02:00
David Nadlinger
9fd1e8d2a6 Merge frontend tag v2.068.0
Kept idgen as C++ program for now. We'll tackle build system integration
once we actually switch to DDMD.
2015-08-29 03:09:17 +02:00
David Nadlinger
ac792497f2 Properly ignore statically known SliceExp bounds
GitHub: Fixes #1008.
2015-08-29 01:34:25 +02:00
David Nadlinger
9474030507 TupleExp stack allocas are a DVarValue
Did not seem to matter before, but allows us not to care
about tuple types in the cleanup forwarding slot code.
2015-08-19 19:56:39 +02:00
David Nadlinger
159a1d0f30 Factor out handling of "magic" intrinsics to separate function 2015-08-19 19:56:39 +02:00
David Nadlinger
f82d3dab89 Re-fix DMD issue 13095 for the new temporary cleanup implementation
Really wish we wouldn't have to deal with all those
glue-layer special cases.
2015-08-19 19:56:39 +02:00
David Nadlinger
a4439fa7b5 Store r-value toElemDtor result in alloca when executing cleanups
See code for an explanation.
2015-08-19 19:56:39 +02:00
David Nadlinger
4bcae9731a The big catch/finally rework, part 2
Now with *almost* working EH codegen. Does not compile Phobos yet
because we run into the "instruction does not dominate all uses"
issue when an r-value result of toElemDtor is used and we need to
run cleanups in between. Should easily be fixed by promoting those
values to allocas.

Most of the changes outside of ir/irfunction.{h, cpp} are just
because CreateCallOrInvoke moved locations. I took the
opportunity to also make use of the different arg count
overloads where possible.
2015-08-19 19:56:39 +02:00
David Nadlinger
4236ae9ce5 The big catch/finally rework, part 1
Never generates any landing pads or invoke instructions right now
for simplicity. The code for emitting them will be added back in
the next step.

The "after..." blocks without any precedessors remain for now, as
we need a clean way to suppress any codegen for that block (but
not new blocks, which might resolve labels) before tackling that
one.

Builds druntime/Phobos on OS X x86_64 (albeit without EH, of course).
2015-08-19 19:56:39 +02:00
David Nadlinger
bfc20df4c8 Remove IRScope::end
Specifying the basic block before which to insert the new one
is not mandatory when calling llvm::BasicBlock::Create. This
was the only use of the tracked "end" block. The concept was
phony anyway because there is no single "end" to a scope with
unwinding and so on.

For prettying up the IR, it is possible to change the order
of basic blocks using move{Before, After}().
2015-08-19 19:56:39 +02:00