Commit graph

267 commits

Author SHA1 Message Date
David Nadlinger
c7c1c25f15 DValue: struct->class.
This is in line with an incoming upstream change making all
polymorphic structs classes, and also matches common coding
conventions.
2013-06-07 03:20:39 +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
87c8a96545 Check initializer type size in IrStruct::getDefaultInit(). 2013-05-19 20:25:16 +02:00
David Nadlinger
7b435c2c87 Unify handling of struct initializers.
GitHub: Fixes #351.
2013-05-18 19:51:37 +02:00
David Nadlinger
b49cbeaaf1 Factored out struct initializer constant generation. 2013-05-17 01:02:02 +02:00
David Nadlinger
beed5c3044 Get rid of empty IrBase class.
It isn't useful in any way now that the GC is out of the
picture, and the existance of a "dummy" toChars() method is
annoying when debugging.
2013-05-15 20:28:53 +02:00
David Nadlinger
f57eac796f Expand on IrType::get rationale. 2013-05-15 20:19:44 +02:00
David Nadlinger
f894a7809c Update catch landingpad codegen to match latest druntime change. 2013-05-11 23:29:39 +02: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
5616753768 Consistently use quotes for LLVM includes. 2013-02-07 21:20:54 +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
104cd77e9c Merge branch 'master' into merge-2.061-2 2013-02-03 15:50:39 +01:00
kai
f806ec0ed5 Attribute holds no longer multiple values in LLVM 3.3.
The solution is to replace Attribute with AttrBuilder in IrFuncTyArg.
Then the argument attributes can be easily manipulated and transformed
into the final AttributeSet.
2013-02-03 15:09:36 +01:00
kai
bfc23acf30 Merge branch 'master' into merge-2.061-2 2013-02-02 15:27:51 +01:00
kai
045d50deb5 Replace SmallVector/vector with C array for type lists 2013-02-02 15:01:13 +01:00
David Nadlinger
30caa4bfe6 Merge branch 'master' into merge-2.061-2 2013-01-12 01:27:02 +01:00
kai
a11459bc31 "The Great Renaming" continues.
More changes to match the renamed files of LLVM 3.3.
2013-01-06 17:17:30 +01:00
David Nadlinger
1a3fc9f97f Fix break out of non-nothrow range foreach.
Fixes DMD testcase 'test9068'.
2013-01-04 16:48:10 +01:00
David Nadlinger
a797e686a0 Updated hidden method error message according to DMD issue 6373.
Fixes DMD testcase 'diag6373'.
2013-01-04 07:31:17 +01:00
David Nadlinger
b3f59134c1 Adapt to new DMD lambda inference mechanism.
Rewriting types this late is a questionable design and prone
to break non-DMD client code; this should be discussed
again with Kenji.
2013-01-04 06:22:57 +01:00
kai
272e7b7a55 Follow "The Great Renaming" in LLVM 3.3
This time VMCore was renamed to IR. Several top level include
files were moved to new subfolder IR.
2013-01-03 08:52:23 +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
a3975b7f47 Replace llvm::Function.getFnAttributes with llvm::Function.getAttributes.
This is a recent change in LLVM 3.3.
2012-12-30 14:27:51 +01:00
David Nadlinger
eac742b9f7 Don't create IrType twice for aggregate arrays with forward references.
GitHub: Fixes #257.
2012-12-27 23:22:46 +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
9d9f827efb Set irtype for underlying function type when building delegate types.
This fixes the problem of arg_nest disappearing when DtoType
is called on such types, e.g. as part of metadata generation.
2012-12-21 00:32:07 +01:00
David Nadlinger
ebbbfdd4ac Metadata/gc2stack compile fixes to accomodate LLVM API changes. 2012-12-20 23:52:24 +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
59a4a02e49 Cleanup: Avoid signed/unsigned comparisons.
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
189115fa98 Cleanup: Move definitions for irfuncty.h to new irfuncty.cpp. 2012-12-20 01:03:01 +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
f68e914da6 Workaround for ICE due to auto return type not being inferred.
GitHub: Fixes #217.
2012-12-19 22:55:18 +01:00
David Nadlinger
1bb14c45d2 Removed trailing whitespace. 2012-12-16 17:19:15 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
David Nadlinger
4512201de5 Removed obsolete IrSymbol class. 2012-12-16 17:19:14 +01:00
David Nadlinger
d5e176484d Verbose log prettification. 2012-12-08 19:19:08 +01:00
kai
83a7258ae4 Add address space number to getPointerSize() calls.
This is required for LLVM 3.2.
2012-10-20 17:49:58 +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
kai
5e03034654 Make LDC compile with LLVM 3.2 again. 2012-09-29 20:51:21 +02:00
David Nadlinger
3eea8de2cf D1 build fix.
Sorry for the breakage, I intended to push the previous change as a pull
request for a CI run, not the main repository.
2012-09-28 02:03:39 +02:00
David Nadlinger
5f6447e52c Fix GitHub issue #168 – alignment of globals. 2012-09-28 01:57:21 +02:00
David Nadlinger
ee4285f934 Properly handle DMD-internal "reference variables".
Previously, we just had a hack to make ref foreach statements work.
This commit enables them to work in other cases as well, like the
implicit __result variable for functions with out-contracts (which
is such a magic ref variable for ref-returning functions).

Fixes DMD testcase 'testcontracts'.
2012-09-07 03:51:33 +02:00
kai
1205e3ea83 Use TargetData to get size of certain types (instead of hard-coded values). 2012-08-25 01:29:42 +02:00
kai
311297b096 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-03 06:32:23 +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
10a0bdf891 More unification work. 2012-07-29 15:19:13 +02:00
kai
e13b115583 More unification work. 2012-07-29 14:22:56 +02:00