Frits van Bommel
424bb88da0
Enable inlining by default for -O3+.
2009-03-29 19:38:59 +02:00
Frits van Bommel
aa508e792a
Forgot to commit this file, sorry
2009-03-29 18:50:41 +02:00
Frits van Bommel
6135e4201a
Small cleanup: remove mars.h #include
2009-03-29 16:47:19 +02:00
Frits van Bommel
257d305032
Change meaning of optimization levels: -O0 now means 'no optimization' like with
...
other compilers.
2009-03-29 15:51:14 +02:00
Frits van Bommel
e129494812
Allow specific optimization passes to be requested from the command line.
...
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge.
The -O<N> options are still supported, and are inserted in the passes list in
the position where they appear on the command line.
(so -simplifycfg -O1 -instcombine does the "right thing")
One small change: -inline is renamed to -enable-inlining due to a naming
conflict with the option to add the -inline pass. -inline now inserts the
inlining pass in the position specified, not in the middle of -O<N>.
(ldmd has been updated to translate -inline to -enable-inlining)
2009-03-29 15:46:55 +02:00
Christian Kamm
f179acda32
Automated merge with http://hg.dsource.org/projects/ldc
2009-03-29 11:44:32 +02:00
Christian Kamm
d7de486493
A different fix to #218 and DMD2682 that does not lead to constant folding regressions.
...
Fixes run/const_15, run/c/const_16_B.
The price is removing the lvalueness of struct literals. If it turns out too
much code depends on this behavior or we don't want to break with DMD, we
could keep struct literals as lvalues and instead convert struct literals used
as expression initializers into struct initializers.
2009-03-29 11:43:45 +02:00
Frits van Bommel
9af4c078a0
Another big-endian fix. (Don't lie to [s]printf...)
2009-03-29 03:53:22 +02:00
Frits van Bommel
7e99e31b91
Clean up some suspicious code.
...
There's no guarantee a constant of integer type is a ConstantInt, so it's not
safe to just cast<> these to ConstantInt. (It could be a constant expression,
for example)
The code is shorter this way too :).
2009-03-29 03:27:04 +02:00
Frits van Bommel
2586278349
This should fix integers below 64 bit on big-endian systems.
2009-03-29 01:29:30 +01:00
Christian Kamm
875a8b25b2
Fix bug in CaseStatement::semantic when there's no enclosing switch.
2009-03-28 21:10:53 +01:00
Christian Kamm
ca6a07e2e5
Emit function bodies before generating the module info to make sure static
...
ctors are collected correctly. Fixes run/constructor_03.
2009-03-28 20:45:33 +01:00
Christian Kamm
42da8b98b1
Do not skip abstract function declarations if they have a function body. Fixes abstract_17_A,B.
2009-03-28 20:25:59 +01:00
Christian Kamm
c5a09c9deb
Force initialize the runtime module in Module::genLLVMModule. It is required
...
for all non-trivial D modules anyway, so why load it lazily? This fixes
run/typeid_83.d (DtoDeclareTypeInfo expects runtime to be initialized)
2009-03-28 20:01:37 +01:00
Christian Kamm
0ef57dcfbe
Reenable error for gotos into or out of finally blocks.
2009-03-28 19:16:53 +01:00
Christian Kamm
b2e601bd74
Add back some enclosing scope-exit information to the frontend to produce
...
proper error messages inside switch statements.
2009-03-28 14:39:16 +01:00
Christian Kamm
99168f443f
Fix goto inside synchronized functions.
2009-03-28 14:26:23 +01:00
Christian Kamm
1bf5934519
Fix path to llvmasm.di in runtime CMakeList
2009-03-28 10:50:44 +01:00
Tomas Lindquist Olsen
14b8aff809
Fixed issue with runtime supplied typeinfo generating multiple symbols.
...
Added new ldc.llvmasm import in runtime cmake file.
2009-03-28 09:45:33 +01:00
Tomas Lindquist Olsen
740cdaa588
Fixed forward reference problem in struct methods on x86-64.
2009-03-28 09:00:32 +01:00
Tomas Lindquist Olsen
e61562033d
Added support for tuple return with __asmtuple!(int,int) etc.
2009-03-28 08:25:58 +01:00
Tomas Lindquist Olsen
1809214995
Added support for single D type register return from __asm.
2009-03-28 07:24:53 +01:00
Tomas Lindquist Olsen
99b863e2b1
Added initial support for raw LLVM inline asm.
2009-03-28 06:32:06 +01:00
Tomas Lindquist Olsen
36f6ebc77f
- Versioned Expresssion::toElem with #if IN_DMD/IN_LLVM.
...
- Eliminated the DLRValue DValue.
- Implemented proactive handling of l-value CastExpS.
- Minor tweak in runtime memory.d .
2009-03-28 05:00:43 +01:00
Tomas Lindquist Olsen
06a29342d3
Added missing new files.
2009-03-27 23:24:47 +01:00
Tomas Lindquist Olsen
be3bfbff5d
Fixed problems introduced by previous commits that prevented Tango from compiling.
2009-03-27 23:17:04 +01:00
Tomas Lindquist Olsen
ec986231e5
Eliminated the need for resolve, declare, const-init and define lists to drive code generation.
2009-03-27 21:50:32 +01:00
Tomas Lindquist Olsen
daef67acc3
Changed use of toObjFile to a new codegen method.
...
More versioning of DMD specific codegen code.
2009-03-27 17:54:27 +01:00
Tomas Lindquist Olsen
c42c90ea80
* Moved ir/irsymbol.cpp/h into ir/irdsymbol.cpp/h.
...
* Added #if IN_DMD versioning around DMD backend specific code in the D1 frontend, D2 is currently broken.
* All part of a greater cleanup scheme.
2009-03-26 20:45:53 +01:00
Tomas Lindquist Olsen
367b8da8f4
Moved IRTargetScopeS from IRState into IrFunction, fixes #240 .
2009-03-26 18:46:21 +01:00
Frits van Bommel
91698fd0a5
Remove a duplicate minitest
2009-03-25 13:46:49 +01:00
Christian Kamm
31b46683e8
Fix to synchronized function storage class when getting the classinfo via dotExp.
2009-03-25 08:13:01 +01:00
Christian Kamm
c189b011b5
Automated merge with http://hg.dsource.org/projects/ldc
2009-03-24 21:18:29 +01:00
Christian Kamm
671c7791e3
Reorganize EnclosingHandlers to require less changes to the frontend and allow us to
...
implement the synchronized storage class for functions.
2009-03-24 21:18:18 +01:00
Tomas Lindquist Olsen
0f34ef81cf
merge
2009-03-24 18:22:47 +01:00
Tomas Lindquist Olsen
187e3c926e
Fixed error when pkg-config couldn't find libconfig, allows user to set flags manually.
2009-03-24 18:22:29 +01:00
Frits van Bommel
479b97ca87
Update DtoConstFP() to be correct after LLVM r67562, which changed the way the
...
APFloat constructor expects its i80 APInts to be formatted. (They're now
actually consistent with the x87 format)
2009-03-24 15:24:59 +01:00
Christian Kamm
a0d93e699a
Automated merge with http://hg.dsource.org/projects/ldc
2009-03-24 14:34:16 +01:00
Christian Kamm
eb1deec50d
Fix #239 .
2009-03-24 14:33:57 +01:00
Frits van Bommel
143e95680f
Remove struct padding which was making this test fail on 64-bit systems.
2009-03-24 03:14:22 +01:00
Frits van Bommel
058998f1ad
Update comments now that LLVM PR3861 has been fixed. However, since
...
conditionally removing the workaround makes the ABI dependent on LLVM version,
I reconsidered that.
(The same revision of LDC compiling for the same target should probably produce
code that follows the same ABI, right?)
2009-03-24 02:46:57 +01:00
Tomas Lindquist Olsen
3ac45285fc
Cleanup DMD 1.041 merge.
2009-03-23 20:26:33 +01:00
Christian Kamm
372b40dd94
Fix tuple declarations in aggregates.
2009-03-23 14:47:51 +01:00
Frits van Bommel
2dcc7be873
Workaround for LLVM PR 3861 ( http://llvm.org/PR3861 ).
...
(LLVM abort()s in codegen if the second integer in a return value is <= i8 on
x86/x86-64)
This was breaking native compilation of Tango's TempFile module on x86-64.
2009-03-23 01:01:55 +01:00
Christian Kamm
ef62f7965c
Bring FrameInfo definition up to date with recent Tango developments. Thanks fawzi!
2009-03-22 14:51:03 +01:00
Christian Kamm
490549e65c
Add dmd-style configuration file for rebuild usage. See #236 and thanks to ccuter for the patch!
2009-03-21 09:47:48 +01:00
Frits van Bommel
d0a8ee9573
Return null from a static class to interface cast if the class reference was
...
null. Fixes #237 .
2009-03-20 15:50:01 +01:00
Frits van Bommel
e242f81475
Fix makewebstatistics: don't try to drop a test multiple times.
2009-03-20 15:47:42 +01:00
Frits van Bommel
d1911d40d6
Fix some issues with fawzi's patch.
...
- It now actually compiles:
- import stdc.stdio for string formatting functions)
- remove extra '{'
- Use snprintf() instead of sprintf().
- Use return value from snprintf instead of strlen().
- Don't print the filename in Exception.writeOut() if it has zero length and
the line number is 0
(It would previously only skip these if the filename was null, but not if it
was a different empty string)
- Ignore empty filename + line number 0 in FrameInfo.writeOut() as well.
2009-03-18 15:33:19 +01:00
Frits van Bommel
e847f60fb1
Apply fawzi's patch from #235 .
...
This has some issues which are addressed in my next commit.
2009-03-18 15:20:07 +01:00