Commit graph

309 commits

Author SHA1 Message Date
Kai Nacke
f772efaec3 Merge branch 'master' into merge-2.064 2013-11-04 02:24:02 +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
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
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
kai
62683c4efe Simplify calling memcpy/memset 2013-08-18 20:56:24 +02:00
David Nadlinger
3035735bc9 FuncDeclaration::canInline diff reduction.
The new arguments to the call in DtoLinkage do not exactly
match what was there before, but have been harmonized with
the other canInline call.
2013-06-14 19:14:19 +02:00
David Nadlinger
b1465ae7e3 Extended DtoLinkage comments. 2013-06-12 20:16:37 +02:00
David Nadlinger
d3f89f81a8 Never emit naked functions as available_externally. 2013-06-12 20:16:37 +02:00
David Nadlinger
2cebe6408c Divided ir/irtypestruct.* in general aggregate and struct specific part.
This is just to improve clarity, as it was rather non-obvious
what of the code also applied to classes before.

IrTypeAggr::createInitializerConstant would currently belong in
IrTypeStruct, but this will be refactored anyway.
2013-06-12 17:17:09 +02:00
David Nadlinger
848dee32d4 Store bools as i8.
I really hope we can refactor this to use a less leaky
abstraction later – it should at least be possible to merge
voidToI8 and i1ToI8.
2013-06-07 03:20:54 +02:00
David Nadlinger
a8ae435c69 Remove bogous DtoMemCpy assertion.
DtoMemCpy is called with identical pointer arguments in
some legal cases.
2013-06-07 02:23:00 +02:00
David Nadlinger
c02b38fe9a Removed LLVM 3.0 compatibility code.
There might be still some pieces left here and there, and
there is certainly code that could be rewritten in a nicer
way with the 3.0 requirement out of the picture.
2013-05-31 20:48:38 +02:00
kai
522c06ff7f Do not memcpy with same source and destination.
This can happen for sret_args. Drop the assignment in this case.
2013-05-10 12:59:14 +02:00
kai
6ab2275f09 Mark string constants as unnamed_addr 2013-03-30 15:28:38 +01:00
kai
b13f3d3164 Merge branch 'master' into merge-2.062
Conflicts:
	runtime/druntime
2013-03-24 19:39:39 +01:00
David Nadlinger
4cd967c4b6 Workaround for private variables pulled in from CTFE'd template functions. 2013-03-22 11:23:34 +01:00
kai
93c4cf3ea5 Replace more occurances of std::vector with an array. 2013-03-17 00:50:05 +01:00
kai
aa4fe6a748 Remove DMDV1 and DMDV2. 2013-03-06 18:18:00 +01:00
kai
1e4a8fffc2 Remove DMDV1 and DMDV2. 2013-03-06 10:20:24 +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
d4b391249d Removed redundant global.params.os field.
I hope I have untangled the checks for "native" Windows (Triple::Win32)
vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly.

MinGW needs some default libraries as well, has to be fixed later.
2013-02-07 21:20: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
9081102f24 Use AttrBuilder for LLVM >= 3.2.
Due to a misunderstanding of the new semantics of the Attribute(s) class,
this class was used in places where class AttrBuilder should be used.
2013-02-02 15:01:13 +01:00
kai
6cb782791e Fix build warnings 2013-01-27 00:38:17 +01:00
kai
28e3a4d80f Replace std::vector with llvm::SmallVector in gen/tollvm.cpp. 2013-01-27 00:13:20 +01:00
kai
b4aca21422 More LLVM 3.3 changes.
There is ongoing rework on the AttributeSet class. Also the constructor
of APFloat changed.
2013-01-23 18:22:45 +01:00
kai
82a3216619 Simplify code.
The code to generate a constant string is too complex. Just use the
method provided by LLVM.
The complexity was introduced during a LLVM refactoring....
2013-01-04 14:35:24 +01:00
kai
2898e5cac3 Add support for PPC 128bit doubledouble type.
On a PowerPC target the datatype real is mapped to PPC 128bit doubledouble type.
Please note that this yet does not work if you cross compile from a different
architecture.
2012-12-30 17:18:36 +01:00
kai
fd0021c6c2 Cleanup: 2 more clang warning fixes. 2012-12-22 16:59:20 +01:00
kai
5f37ae30cf LLVM 3.3: class Attributes is renamed to Attribute.
Some other renamings took place in "llvm/Attributes.h" but only this causes
compile errors in LDC.
Also uses new location of "llvm/IRBuilder.h".
2012-12-21 17:32:17 +01:00
David Nadlinger
a3a511ca55 Refactored IrType construction to use static get() method.
This also allows us to enable the assert in IrType::IrType.

Unfortunately, this is mostly a "peace of mind" commit, there
doesn't seem to have been a bug actually caused by the transitory
duplicate IrTypePointer/IrTypeStruct instances.

The remaining xyz2llvm static methods are not exactly pretty,
they should probably just be folded into get.
2012-12-20 23:52:09 +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
d5e176484d Verbose log prettification. 2012-12-08 19:19:08 +01:00
kai
fde625b33d More changes to the Attributes class in LLVM 3.2. 2012-10-20 17:22:55 +02:00
kai
657fc42221 And still more changes for LLVM 3.2
There were additional changes to the Attributes class.
2012-10-15 18:31:18 +02:00
kai
a7c7b514c0 Add changes for LLVM 3.2
- The Attributes class was changed again
- TargetData was renamed to DataLayout

Compiles again with LLVm 3.0, 3.1 and trunk(3.2).
2012-10-13 18:54:42 +02:00
David Nadlinger
051cd7302e Fixed two issues with nested functions as template alias parameters.
Fixes #131 (GitHub).
2012-10-07 03:06:07 +02:00
David Nadlinger
da17b7c6b6 Only invoke mustDefineSymbol() once in DtoLinkage.
This is, of course, a microoptimization, but more importantly
makes stepping through the code easier.
2012-10-07 00:03:10 +02:00
kai
4ae64dd2e7 Fix size returned by os_critsecsize() and construct type for D_CRITIAL_SECTION on Windows. 2012-09-08 11:49:37 +02:00
Jernej Krempuš
3d108ee684 Fixed a bug in gen/tollvm.cpp. 2012-08-05 18:46:52 +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
kai
b53544b389 Simplify code by using the right type.
Removes some comditional compiling by replacing unsigned with llvm::Attributes.
2012-07-29 18:18:36 +02:00
kai
bf2aaaca84 More unification work. 2012-07-29 16:13:52 +02:00
David Nadlinger
6f236518b5 Fixes #123 – Linking of pre/post-condition in interface fails when interface implemented in separate module. 2012-06-19 22:37:46 +02:00
kai
48f8ffeb0b Further changes to compile using MSVC. 2012-05-23 17:36:26 +02:00
Alexey Prokhin
ae7f0ca7e7 Preliminary vector support 2012-02-16 14:42:23 +04:00
Alexey Prokhin
f2ed2e96b0 Use optimized array operators implemented in druntime 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