Commit Graph
1471 Commits
Author SHA1 Message Date
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
kai fb108eed12 More LLVM 3.2 changes. 2012-10-14 18:45:31 +02:00
kai 8519f448f8 Improve error message if gcc or other tools can not be found.
This fixes #192.
2012-10-14 12:39:35 +02:00
David Nadlinger 11619e55a9 Fix miscompilation of some functions returning structs. 2012-10-14 03:41:15 +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
David Nadlinger c9e2fc34d1 Cleanup.
If ad would be null, the code above would have already crashed.
2012-10-06 20:40:14 +02:00
David Nadlinger bb24f9bafe Log messages: Fixed references to "toObjFile()". 2012-10-06 19:32:42 +02:00
David Nadlinger 5fa1a903e8 DtoResolveStruct cleanup.
irField is only set in DtoResolveStruct, so the comment was misleading.
2012-10-06 19:27:55 +02:00
David Nadlinger 2d54a02295 Use null instead of undef for unneeded nested context pointers. 2012-10-06 13:07:17 +02:00
Jernej Krempuš 7966abeb5e Bitcast the LLValue to the correct type. 2012-10-05 21:58:19 +02:00
Jernej Krempuš 39300283c0 Made casts between vector types work. 2012-10-05 19:38:43 +02:00
David Nadlinger 4e49814afb Vector -> static array casts are by address.
Fixes #176 (GitHub).
2012-10-05 17:23:31 +02:00