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
4804cbcdbb
Cleanup: Removed unused variable.
2012-12-20 03:29:06 +01:00
David Nadlinger
89809fdde3
Cleanup: Silence another "maybe-undefined" warning.
...
Also makes the assert in line 775 actually work.
2012-12-20 02:10:32 +01:00
David Nadlinger
0be65aa49b
Add back line accidentally removed in 289bb57a.
2012-12-20 02:07:11 +01:00
David Nadlinger
4118cddd1f
Cleanup: GCC warning fixes.
2012-12-20 01:21:10 +01:00
David Nadlinger
ab357a41c7
Removed useless debug log messages.
2012-12-20 01:21:10 +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
0efa499b22
Cleanup: Actually use forward-declared types.
2012-12-20 01:00:59 +01:00
David Nadlinger
fca550e534
Cleanup: Remove warning overrides and fix two more warnings.
2012-12-20 01:00:57 +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
289bb57adf
Cleanup: Fix "braces around initializaion of subobject" warnings.
...
The two ASM implementations should really be merged, as they
are very similar except for the added registers/instructions.
2012-12-20 01:00:51 +01:00
David Nadlinger
fb363972f0
Fix handling of NewExpression for structs with constructors.
...
The frontend treats the constructor as returning a reference to
the new instance, we just want the memory, i.e. a pointer.
GitHub: Fixes #246 .
2012-12-19 20:57:52 +01:00
David Nadlinger
db59b30eda
Slight rewrite to make intent cleaner.
...
No functionality change intended, although it might make the last
commit unnecessary.
2012-12-19 20:38:54 +01:00
David Nadlinger
9cbfc604c7
Fix ICE with closures in member functions.
...
I chose to fix the problem this way because it increases uniformity
between 'this' and normal explicit parameters. Another possibility
would be to just change the type determinatin code in
DtoCreateNestedContextType to not expect the value to be already
present, because it doesn't need it when isVthisPtr is true anyway.
GitHub: Fixes #217 .
2012-12-19 20:27:19 +01:00
David Nadlinger
080d0cef0f
Debug log formatting fix.
2012-12-19 19:49:03 +01:00
David Nadlinger
e068df24b2
Workaround for AA literal initialization ICE.
...
Just executing toConstElem speculatively in
AssocArrayLiteralExp::toElem probably isn't the best idea
anyway, I would not be surprised if there are other similar bugs.
GitHub: Fixes #248 .
2012-12-19 02:09:19 +01:00
David Nadlinger
2988bc46e0
Removed long obsolete (and broken) LLVM IR annotation code.
...
If someone wants to redo this properly, an idea that actually works
would be to use a custom llvm::AssemblyAnnotationWriter.
2012-12-19 01:50:48 +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
kai
1a06130cfa
AttrListPtr is renamed to AttributeSet in LLVM 3.3.
2012-12-09 19:48:39 +01:00
David Nadlinger
94bd923e96
Fixed pragma(LDC_verbose).
2012-12-08 21:41:22 +01:00
David Nadlinger
cbc7028e50
Added vendor-prefixed pragma names, deprecated old ones.
2012-12-08 21:38:54 +01:00
David Nadlinger
a39a136e14
Line breaks, slight cleanup.
2012-12-08 21:38:54 +01:00
David Nadlinger
f79b998e87
Whitespace cleanup.
2012-12-08 21:38:54 +01:00
David Nadlinger
dfa1bd954d
Removed {insert, extract}element and shufflevector pragmas.
...
They have been superseeded by the inline IR pragma and ldc.simd,
and have only been around for a short time (and not in any
released version).
2012-12-08 21:38:54 +01:00
David Nadlinger
d5e176484d
Verbose log prettification.
2012-12-08 19:19:08 +01:00
David Nadlinger
2d02270434
Re-enabled codegen optimization on LLVM 3.2.
...
The bug (PR14376) has been fixed in both master and the release branch.
2012-11-24 14:07:17 +01:00
David Nadlinger
19f570bcb9
AttrListPtr also requires the context arg in LLVM 3.2 now.
2012-11-24 12:40:12 +01:00
kai
2fec23b84e
AttrlistPtr::get() now requires context as first argument.
...
This is the first LLVM 3.3 related change.
2012-11-21 22:10:26 +01:00
kai
45848d19fc
Remove unused include. This fixes yet another MSVC-related compile problem.
...
Root cause is the `root.h` defines `strtof` which is used in `llvm/Target/TargetLibraryInfo.h` as an enumeration identifier.
2012-11-18 17:52:10 +01:00
David Nadlinger
34e1415f35
Merge pull request #226 from jerro/pragma-llvm-inline-ir
...
Pragma llvm_inline_ir
2012-11-15 12:05:17 -08:00
David Nadlinger
540888d6d0
Removed tautological #if block.
2012-11-11 00:32:15 +01:00
David Nadlinger
d14a869c19
Only emit a single bitcast for struct literal padding.
...
Mostly a cosmetic change.
2012-11-10 20:22:56 +01:00
David Nadlinger
5944e9cc51
Correctly zero out real padding in struct literals.
...
Fixes the std.variant unit tests on x86_64.
2012-11-10 20:11:10 +01:00
Jernej Krempuš
7bbe782615
Pragma llvm_inline_ir
...
Adding pragma llvm_inline_ir.
Improved the error messages.
Append "ret void" when the return type is void
Improved the error message
in case when the string passed as llvm inline ir isn't valid llvm
assembly language.
LLVM 3.2 fix.
Add attribute AlwaysInline inside DtoInlineIRFunction.
Always generate a body for llvm_inline_ir
Also, always make llvm_inline_ir functions linkonce_odr. Because
the body is always generated when a module uses a llvm_inline_ir
function, the fact that the linker removes the function shouldn't
cause problems.
2012-11-08 22:05:15 +01:00
David Nadlinger
45a3060da7
Prettied up nested context debug output.
...
The assertion is currently triggered when building the Tango/D1 unit tests.
2012-11-08 21:44:14 +01:00
David Nadlinger
c558f9caab
Added -disable-simplify-libcalls.
...
-disable-simplify-drtcalls was only intended to disable our
custom druntime call simplication pass for debugging purposes.
The new flag controls C runtime library calls optimizations as
performed by the LLVM pass, just as the corresponding LLVM tool
flags do.
2012-11-06 23:53:59 +01:00
David Nadlinger
03ef134aad
StripExternals only makes sense with GlobalDCE for cleanup afterwards.
2012-11-06 23:48:19 +01:00
David Nadlinger
fbd62f0532
It makes no sense to not inline alwaysinline functions.
2012-11-06 23:47:12 +01:00
David Nadlinger
0647cfb50c
Re-enable inlining by default for -O2 and above.
...
This fixes a bug introduced in 2f78dc686 .
Thanks to Jernej (jerro) for the fix!
2012-11-06 19:40:18 +01:00
David Nadlinger
08a8f5df9b
Fixed LLVM function attribute handling.
...
Previously, set_param_attrs would overwrite any pre-existing
attributes, which is problematic, as per-function attributes are
also stored in a slot in that attribute list. This for example
lead to "noinline" being dropped for functions with inline asm.
2012-11-04 17:48:26 +01:00
David Nadlinger
f95371aeb5
Amend -verify-each description to PassManagerBuilder changes.
...
We can't verify after each pass anymore with PassManagerBuilder, but
-verify-each is a hidden flag mainly useful for debugging our own
passes anyway.
2012-11-04 00:56:36 +01:00
David Nadlinger
dbe5e97d85
Clean up optimizer command line switch descriptions.
2012-11-04 00:56:36 +01:00
David Nadlinger
2f78dc686d
Use llvm::PassManagerBuilder for optimization scheduling.
...
This commit is based on Kai's pull request #157 .
2012-11-04 00:56:36 +01:00
David Nadlinger
07888f95e4
D1: Fixed accessing parameters in contracts.
...
This reverts the changes from commit f7e5245 and implements the
proper fix – in D1, contracts are treated as normal nested functions.
GitHub: Fix #138 .
2012-10-21 01:11:04 +02:00
David Nadlinger
ece5176aa9
D1: Fix Tango build.
...
'this' for methods nested in structs is now internally passed as a
pointer, even if struct this is by value in D1.
2012-10-21 01:11:04 +02: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
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