Commit graph

143 commits

Author SHA1 Message Date
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
Alexey Prokhin
89573a731a Fix DMD Issue 10451 - Array of pointers to opaque struct gives forward reference errors. 2013-12-08 14:43:45 +04:00
Alexey Prokhin
5a181d9312 Update struct type info generation to reflect changes in dmd frontend 2013-12-08 14:36:59 +04:00
Alexey Prokhin
d235e4cc28 Fix DMD Issue 10425 - Link error with templates.
Merged dmdfe changes in typeinf.c
2013-12-08 13:17:49 +04:00
Kai Nacke
87965cdc19 Merge branch 'master' into merge-2.064
Conflicts:
	runtime/druntime
2013-11-26 08:00:10 +01:00
Kai Nacke
7f017608a8 Use enum literal instead of constant 2013-11-26 07:56:50 +01:00
Kai Nacke
cef5b27400 Revert "Declare more TypeClass instances as builtin."
This reverts commit f7f62a609d.
2013-11-07 17:13:45 +01:00
Kai Nacke
f7f62a609d Declare more TypeClass instances as builtin.
Another difference to DMD. With the new TypeInfo, this should work now.
2013-11-03 15:23:11 +01:00
Kai Nacke
ecefd81c42 Possible fix for the current segfaults.
DMD treats immutable(char)[] and cons(char)[] as builtin.
The latter was missing in LDC.
2013-11-03 13:45:25 +01:00
David Nadlinger
cb341586e3 First merge of 2.064 beta.
This corresponds to DMD commit a913ce4bc59a94a022a27e390fc841f4aededffb.

Doesn't build Phobos yet.
2013-10-29 19:21:15 +01: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
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
David Nadlinger
787c147986 Use Module::members -> Dsymbol::codegen to define symbols.
This commit fundamentally changes the way symbol emission in
LDC works: Previously, whenever a declaration was used in some
way, the compiler would check whether it actually needs to be
defined in the currently processed module, based only on the
symbol itself. This lack of contextual information proved to
be a major problem in correctly handling emission of templates
(see e.g. #454).

Now, the DtoResolve…() family of functions and similar only
ever declare the symbols, and definition is handled by doing
a single pass over Module::members for the root module. This
is the same strategy that DMD uses as well, which should
also reduce the maintainance burden down the road (which is
important as during the last few releases, there was pretty
much always a symbol emission related problem slowing us
down).

Our old approach might have been a bit better tuned w.r.t.
avoiding emission of unneeded template instances, but 2.064
will bring improvements here (DMD: FuncDeclaration::toObjFile).
Barring such issues, the change shoud also marginally improve
compile times because of declarations no longer being emitted
when they are not needed.

In the future, we should also consider refactoring the code
so that it no longer directly accesses Dsymbol::ir but uses
wrapper functions that ensure that the appropriate
DtoResolve…() function has been called.

GitHub: Fixes #454.
2013-10-13 19:18:24 +02:00
David Nadlinger
3d9b70c7a6 Mention TypeInfo emission in debug log. 2013-10-13 01:00:24 +02:00
kai
b1160c3d16 Fix for issue #440 2013-08-17 13:02:26 +02:00
David Nadlinger
1215ffacd3 Complete IrStruct->IrAggr rename. 2013-06-17 13:14:15 +02:00
David Nadlinger
4774745f44 Do not try to generate metadata for unresolved types.
This does not fix the root cause, which is likely a frontend
bug/oddity, but avoids the crash.
2013-06-16 20:23:07 +02:00
David Nadlinger
e9d7c10109 Align our copy of TypeInfo code to upstream DMD version. 2013-06-15 15:11:17 +02:00
David Nadlinger
292caa1438 Merge the 2.063 frontend. 2013-06-12 20:16:37 +02:00
David Nadlinger
f2f3c751b3 Renamed IrStruct to IrAggr, as it is also used for classes.
The class-specific parts should probably be factored out.
2013-06-12 17:16:35 +02:00
David Nadlinger
f7aac5201b Remove unused extra argument to overload checking functions. 2013-06-07 21:23:19 +02:00
David Nadlinger
187899b5e6 Avoid emitting invalid IR for function type TypeInfo metadata.
This fixes LLVM debug builds of the DMD testsuite.
2013-06-07 02:58:04 +02:00
David Nadlinger
43e27d0dd1 Remove USE_METADATA.
It has been on by default for quite some time now.
2013-06-07 02:48:53 +02:00
David Nadlinger
9fbad3c4ba Removed tautological checks.
They were probably used during initial development of the
pass to be able to disable emission of the global reference
by setting TD_TypeInfo to -1.
2013-06-07 02:45:44 +02:00
David Nadlinger
af699bd76e Rename TD_Confirm to TD_TypeInfo.
The old name probably was a reference to the fact that the
metadata node is used to _confirm_ that a metadata record
found by name really belongs to a given TypeInfo instance,
but I found it to be rather non-intuitive.
2013-06-07 02:41:10 +02:00
David Nadlinger
7d740a6d5b Emit null init() ptr for zero-initialized structs.
Fixes std.algorithm tests.
2013-03-17 18:07:00 +01:00
kai
0fd586a818 Remove STRUCTTHISREF 2013-03-06 18:18:00 +01:00
kai
aa4fe6a748 Remove DMDV1 and DMDV2. 2013-03-06 18:18:00 +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
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
8ff3a8060a Use llvm_unreachable instead of assert(0).
Also removed some unused functions.
2013-02-07 03:38:15 +01:00
kai
1ba0681197 2nd attempt to fix issue #253. 2012-12-21 22:45:09 +01:00
kai
df4a245040 Resolve mismatch between object.di and typinfo.cpp on 64bit non-x86 systems.
On Windows x86_64, class TypeInfo_Struct contains 2 additional fields
(m_arg1/m_arg2) which are used for the X86_64 System V ABI varargs
implementation. They are not present on any other os.

This commit changes an assertion which did not check for the os and therefore
broke on 64bit non-86 systems like ppc64.
2012-12-21 22:05:28 +01:00
David Nadlinger
ebbbfdd4ac Metadata/gc2stack compile fixes to accomodate LLVM API changes. 2012-12-20 23:52:24 +01:00
David Nadlinger
464c695814 Renamed IrType::get/IrType::getD, treat classes as the special case they are. 2012-12-20 23:52:09 +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
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger
540888d6d0 Removed tautological #if block. 2012-11-11 00:32:15 +01:00
David Nadlinger
c6abdcf4a4 Don't set TypePointer::isunsigned to true in the frontend.
The previous solution was problematic because the change was language-
visble via the isUnsigned trait. Now, pointers are simply explicitly
checked for in the relevant places. (Note that there might be cases in
the diff where a direct isunsigned() call would have been appropriate –
I only checked for instances where the type clearly cannot be a pointer,
but chose to go the safe route in replicating existing behavior
otherwise).

Fixes DMD testcase 'traits'.
2012-09-28 00:28:49 +02:00
David Nadlinger
4ae14449ea Emit new TypeInfo layout.
Includes untested support for RTInfo.
2012-09-07 03:51:32 +02:00
David Nadlinger
8ebd2ce5a6 More CRLF->LF line ending conversion. 2012-09-07 03:51:32 +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
07bf68afa3 DMD Issue 5590 - Regression(2.036) ICE(e2ir.c): when using .values on enum which is associative array 2012-04-21 22:37:36 +04:00
Alexey Prokhin
ae7f0ca7e7 Preliminary vector support 2012-02-16 14:42:23 +04:00
Alexey Prokhin
e74e55df89 Merge 2.058beta 2012-02-15 13:23:16 +04:00
Alexey Prokhin
edc4a5f003 DMD Issue 5416 - null should have a type of its own 2011-12-16 20:15:10 +04:00
Alexey Prokhin
8b50928636 Fixed #37 — ICE: llvm::GlobalVariable::setInitializer assert failed 2011-12-06 13:55:01 +04:00
David Nadlinger
fe19ee84f5 Merge branch 'llvm3.0' into merge-3.0
Conflicts:
	gen/configfile.cpp
2011-12-04 18:16:36 +01:00
kai
a5b3dd29b5 Fixes 2 kinds of warnings.
1) The last parameter of getGetElementPtr() has type bool. In some instances, a 2 is used as parameter. This is converted to true.
2) Several loops use int instead of unsigned. This causes warning about signed/unsigned mismatch.

Curiously, only Visual C++ complains about this. Nevertheless I think that the warnings should be fixed.
2011-11-23 19:01:04 +01:00
David Nadlinger
ffe37c4a62 Merge remote-tracking branch 'upstream/llvm3.0' 2011-11-12 19:51:30 +01:00