Commit Graph

  • 8cad8d6c7a Merged ABI changes into D2 frontend. Tomas Lindquist Olsen 2009-03-03 14:10:37 +01:00
  • 84963b9a03 Oops, merge with mainline and actually push this time... Frits van Bommel 2009-03-03 09:51:15 +01:00
  • 6778f06dfe Fixed #218 by disabling the problematic optimization. Tomas Lindquist Olsen 2009-03-03 04:41:11 +01:00
  • 5dbe3ee8e2 Abstracted more (most) ABI details out of the normal codegen. Tomas Lindquist Olsen 2009-03-03 02:51:21 +01:00
  • a742c59a67 Pass -m32/-m64 on to gcc when assembling and linking Frits van Bommel 2009-03-01 22:59:03 +01:00
  • 100815c097 Fixed find alt script. Tomas Lindquist Olsen 2009-03-01 22:40:15 +01:00
  • 5275ac0db4 Added script to find the alternative triple of the host. Tomas Lindquist Olsen 2009-03-01 22:27:37 +01:00
  • a71b028a0f Implemented basic -m32 and -m64 options. Tomas Lindquist Olsen 2009-03-01 22:27:03 +01:00
  • 3d6b0b68d5 Remember to set asm type back to void and n=0 when rewriting to sret asm return. Tomas Lindquist Olsen 2009-03-01 20:22:10 +01:00
  • ee1e545a0a Removed some code that wasn't supposed to be in last commit! Tomas Lindquist Olsen 2009-03-01 19:06:47 +01:00
  • 61dfb11bc5 - Fixed x86-32 C ABI for complex number return values. - Removed unused code from the ABI class. Tomas Lindquist Olsen 2009-03-01 19:01:05 +01:00
  • 757601af09 Remove Tango patch that's been applied upstream. Frits van Bommel 2009-03-01 11:04:05 +01:00
  • 093a22d1d2 Just forgot an opcode for x64 Kelly Wilson 2009-02-28 18:17:45 -07:00
  • 1ba0dc70f1 Same fix for align size of void type on D2. Tomas Lindquist Olsen 2009-03-01 01:34:20 +01:00
  • c3504e59f3 Fixed alignsize for void types. (it's one byte) Tomas Lindquist Olsen 2009-03-01 01:33:08 +01:00
  • dd41366a99 Use llvm::CallSite instead of custom CallOrInvoke class. Frits van Bommel 2009-02-28 22:16:52 +01:00
  • b7febcf35a Error gracefully for +=, -=, *=, /= if rhs is complex but lhs isn't. Christian Kamm 2009-02-28 19:58:30 +01:00
  • 031474c724 Apply previous changes to dmd2/mtype.c as well. Frits van Bommel 2009-02-28 17:44:53 +01:00
  • 94790c0cdf Automated merge with http://hg.dsource.org/projects/ldc Frits van Bommel 2009-02-28 17:35:45 +01:00
  • d4fdbf59a1 Use LLVM alignment data instead of hand-picked. Frits van Bommel 2009-02-28 16:09:44 +01:00
  • 99ed181690 Preparation for next patch. Don't ask about why this is needed. I hate the preprocessor. Let's just leave it at that. Frits van Bommel 2009-02-28 16:09:35 +01:00
  • 2f5b7bcd3e Readded indentation that got lost in the dmd/mars.c -> gen/main.cpp move. Christian Kamm 2009-02-28 15:06:09 +01:00
  • d3ea6fb855 Fix alignment info of cdouble, cfloat. They align the same as double, float now. Christian Kamm 2009-02-28 13:48:49 +01:00
  • 993a624e3e Don't reset gTargetData after compiling a module. Fixes segfault when compiling more than one file. Christian Kamm 2009-02-28 09:06:25 +01:00
  • 70b97b9d1e Remove initialization of padding of reals, ireals and creals. According to the spec and C ABIs, the contents of padding is undefined. This was breaking dstress creal_01,02,03,07,08,09 and 20 on x86-64. Frits van Bommel 2009-02-27 19:41:25 +01:00
  • 2beff65988 Fix struct field alignment on x86-64 (for align > 8, like real.alignof) Frits van Bommel 2009-02-27 12:35:31 +01:00
  • 03ce6604a0 Fix cfloat return on x86_64: only perform ABI transformation for non-extern(D) functions. There's no need to waste cycles with extern(D), which we get to define ourselves. Fixes tests/mini/asm8.d. (Since the asm abiret code already assumed {xmm0, xmm1} returns) Frits van Bommel 2009-02-26 23:35:39 +01:00
  • 4f51adc810 Implement support for intrinsics returning struct types (such as llvm.*.with.overflow) Frits van Bommel 2009-02-26 22:47:06 +01:00
  • 693e796893 Fixed druntime lib path in ldc2.conf.in, thanks Matt Tomas Lindquist Olsen 2009-02-26 18:43:25 +01:00
  • bcd05cf258 Added some missing version identifiers. Tomas Lindquist Olsen 2009-02-26 18:28:50 +01:00
  • 7ef533b136 Fixed debug info for globals in D2. Tomas Lindquist Olsen 2009-02-26 18:02:13 +01:00
  • 886a66f4e0 Missing %s error param in main.cpp Tomas Lindquist Olsen 2009-02-26 15:51:19 +01:00
  • 001f83a296 Don't crash if we don't know what ABI to use. Assume some defaults instead. Frits van Bommel 2009-02-26 15:23:52 +01:00
  • 695fc3f5c3 Fix some -vv output Frits van Bommel 2009-02-26 14:51:05 +01:00
  • e37c82d1ec Use LLVM OStream wrapper instead of <iostream> in the logger. llvm::OStream provides all std::ostream functionality (by holding a std::ostream* internally), but * doesn't include <iostream>, avoiding per-file overhead. * allows the stream pointer to be null, and the (inlined) operators do nothing when that's the case. (This also allows removal of the ofstream("/dev/null") hack Logger used when disabled, which presumably wasn't very portable) Frits van Bommel 2009-02-26 14:51:02 +01:00
  • 58a8711bc1 Fixed const/invariant struc/class fields of the form const int i = 4; they don't add a field. Tomas Lindquist Olsen 2009-02-26 15:24:20 +01:00
  • 1a155e6439 Fix dstress runner to use ldmd Frits van Bommel 2009-02-26 14:49:32 +01:00
  • ff31c804a9 Fix x86_64 cfloat support to work on intended target :) Frits van Bommel 2009-02-26 14:48:47 +01:00
  • d5d15cdc05 oups, seems like I broke some constness in D1 last commit, compiles again! Tomas Lindquist Olsen 2009-02-26 14:23:18 +01:00
  • 024946219a Forgot new files that were supposed to be in last commit. Tomas Lindquist Olsen 2009-02-26 14:13:27 +01:00
  • 57a69e8177 - Fixed LLVM style CL args for D2. - Moved main() into its own file gen/main.cpp - Fixed basic cross compilation - removed the option for setting OS - added support for llc's mattr, mcpu and mtriple switches - added basic ABI abstraction for return value rewrites, it's not perfect and will probably be completely rewritten once I get to handling parameter rewrites as well. - x86-64 extern(C) abi for cfloat returns now match (llvm-)gcc. Tomas Lindquist Olsen 2009-02-26 14:11:49 +01:00
  • f61733cb57 Call llvm_shutdown when shutting down the backend. Frits van Bommel 2009-02-25 19:30:06 +01:00
  • b3d87205ad Use LLVM-style command line (instead of DMD-style) Note: For a backward compatible interface, use the new bin/ldmd script. It supports all old options while passing on anything it doesn't recognize. Frits van Bommel 2009-02-25 17:34:51 +01:00
  • 6a02292c10 Clean up regexes in .hgignore, making it more strict. Frits van Bommel 2009-02-19 13:51:44 +01:00
  • 9259089c2b Removing ldc.conf. (IMPORTANT: run 'cmake .' after pull) Added it to .hgignore. This gets rid of spurious differences caused by CMake regenerating it differently. Just run 'cmake .' to get it back in your local checkout. Frits van Bommel 2009-02-19 13:50:05 +01:00
  • ad7ad71e11 Fix out-ouf-source build for runtime as well. To build out-of-source, follow these steps: # [[Insert LLVM build instructions here]] mkdir my_build_dir cd my_build_dir svn co http://svn.dsource.org/projects/tango/trunk tango ccmake <PATH_TO_SOURCE> # (Regular ccmake stuff, press 'c' a few times followed by 'g') make make runtime # add PWD/bin to PATH Frits van Bommel 2009-02-19 11:01:34 +01:00
  • bfacf4477c Add explicit paths to revisions.* to unbreak out-of-source build. Frits van Bommel 2009-02-19 00:50:35 +01:00
  • 9ab133963d Update some testcases now that 64-bit immediates are working. Frits van Bommel 2009-02-18 23:18:34 +01:00
  • 8ce2c9773e Clean up the code generated when jumping out of inline asm and make label names more expressive. Frits van Bommel 2009-02-18 22:50:22 +01:00
  • e3d6b1c051 Fix some assembler issues: The assembler was miscompiling "add" (specifically, the "add reg/mem, imm" variations). The change that caused this seems to have been made because without it, some "add"s didn't compile at all. Frits van Bommel 2009-02-18 21:46:14 +01:00
  • 3ee7952451 Fix a latent bug in the asm code. I think that technically, using "*m0" instead of "*0" allows LLVM to pick between using the same memory as output 0 and using a new memory location. (So far I haven't been able to construct a testcase that actually breaks because of this, though) Frits van Bommel 2009-02-18 03:38:12 +01:00
  • 976096811c Update .hgignore due to moved(?) idgen/impcnvgen locations. Also add *.patch and *.diff. Frits van Bommel 2009-02-17 23:14:19 +01:00
  • 461544fce8 Fix for fix from [974]. Christian Kamm 2009-02-17 19:08:38 +01:00
  • b3de4e773e Fix #217. getInternalTypeInfo doesn't work with LDC. Christian Kamm 2009-02-17 18:57:11 +01:00
  • f62df176d6 Allow 'return exp;' for void main(). Christian Kamm 2009-02-17 18:53:15 +01:00
  • d6a264e74b Fix #216 by implementing TypeExp::toElem. It just provides the appropriate error message. Christian Kamm 2009-02-17 18:25:34 +01:00
  • aa85c805c1 Change the way the version is printed (more verbose, with short hash) If the user has patches managed by the mq extension, the version and hash printed are those of the qparent revision (the revision the patches were applied on top of) instead of tip. Also fixes a bug: print LLVM revision even if there are local modifications to it. Sorry for the long line in the perl file. I have no idea how to break it up. Frits van Bommel 2009-02-17 01:13:18 +01:00
  • 9cad440d4c Fix the problems exposed by the callingconv1.d test case. Frits van Bommel 2009-02-17 00:08:20 +01:00
  • 7c7ed26a17 Revert wilsonk's "fix" for the callingconv1.d problem. Frits van Bommel 2009-02-16 23:56:56 +01:00
  • f5bd002d80 Add some extra debug output that's useful in diagnosing inline assembler bugs. Frits van Bommel 2009-02-16 23:56:56 +01:00
  • 9186ee8935 Fix {,w,d}char handling in tests/mini/vararg6.d:print() Frits van Bommel 2009-02-16 19:31:10 +01:00
  • 913669eab5 Fix test on x86-32. Christian Kamm 2009-02-16 19:17:15 +01:00
  • 51385fe325 Reduce size of integer constant make x86-64 asm parsing code compile on x86-32. Christian Kamm 2009-02-16 18:27:33 +01:00
  • 62e0f85043 Merging fvbommels fix for asm8.d x86-64 code Kelly Wilson 2009-02-15 23:09:53 -07:00
  • b77c44b7dc Fix for tests/mini/callingconv1.d Kelly Wilson 2009-02-15 22:56:10 -07:00
  • 347cfc419d Some changes I missed in my last commit (wound up in wrong patch file) Frits van Bommel 2009-02-16 01:43:14 +01:00
  • 7ea5df5a26 Fix 32 bit truncation of 'asm { movq RAX, 0xAA_1234_5678; }'...ie. move constant larger than 32 bits Kelly Wilson 2009-02-15 16:30:15 -07:00
  • cc02076479 Fix shl/r bad operand size error Kelly Wilson 2009-02-15 16:26:12 -07:00
  • 648e0b02cc Add OSX version declaration for Mac OS X to improve dmd-mac compatibility. Christian Kamm 2009-02-15 21:44:03 +01:00
  • 2dec6aeb41 Implement implicit return after inline asm on x86_64 Frits van Bommel 2009-02-15 18:04:22 +01:00
  • f0dc6cb13e Static ctors/dtors added via template mixins should not be added to modules that just import a module containing such a mixin. Christian Kamm 2009-02-15 14:54:36 +01:00
  • 5471533dd0 Backed out changeset [369996c08420]. Christian Kamm 2009-02-15 14:50:33 +01:00
  • 89bf7d82d7 Change the numbering of static ctors/dtors to be module based instead of being global. Christian Kamm 2009-02-15 11:46:28 +01:00
  • 0676cf018d Make sure debug info uses the right compilation units - in particular the current cu if a symbol is a template instance. Fixes #211. Christian Kamm 2009-02-14 21:18:47 +01:00
  • 4dee095dc3 Added support for using a temporary to implement emulated ABI return from inline asm, could be easier to use, but I think this will do. It's so extremely target dependent in any case that doing a completely generic approach seems hard. Tomas Lindquist Olsen 2009-02-14 15:25:48 +01:00
  • 3e17a21e0b Merged a bunch recent dmd v1 frontend changes into the dmd v2 tree. Tomas Lindquist Olsen 2009-02-13 22:20:30 +01:00
  • cedd029720 Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-02-12 18:39:14 +01:00
  • b3524ef5f4 Now that we're using LLVM 2.5, we can stop always running the CFGSimplification pass. Christian Kamm 2009-02-12 18:39:03 +01:00
  • 6511dc8239 Revert return value swapping on x86_64 Kelly Wilson 2009-02-11 08:32:33 -07:00
  • 707c7bc29f changes to get the naked asm stuff working for x64 Kelly Wilson 2009-02-10 08:02:25 -07:00
  • a4ca550874 Revert templates to old behavior. Christian Kamm 2009-02-08 21:44:46 +01:00
  • 789eefd943 Switch some getModule to getCompilationModule to make sure templates are emitted in the right module. Christian Kamm 2009-02-08 18:51:32 +01:00
  • 7c93355672 Mostly rewrite debug info generation in terms of llvm/Analysis/DebugInfo.h. Add getCompilationModule to Dsymbol and fix template compile unit decision code. Runtime compiles with -g again. Christian Kamm 2009-02-08 16:50:22 +01:00
  • fc480b7fd8 SWITCHED TO LLVM 2.5 ! Tomas Lindquist Olsen 2009-02-08 05:26:54 +01:00
  • 3f7c7c5327 Fixed accessing function symbols from inline asm. Ran x86(-64) asm processors through a code formatter. Tomas Lindquist Olsen 2009-02-08 05:14:24 +01:00
  • 54c3e2cf0c Reverted the template instantiation changes from rev [940]. Wasn't safe it seems :( Tomas Lindquist Olsen 2009-02-05 18:17:42 +01:00
  • 319e058410 Reverted back to the LLVM_InlineAsm_X86 versions, a few more things still needs to be sorted out first. Tomas Lindquist Olsen 2009-02-04 20:47:27 +01:00
  • ab521c06ff LDC should follow the D ABI now. Switch back from LLVM_InlineAsm_X86 to D_InlineAsm_X86. Christian Kamm 2009-02-04 18:51:11 +01:00
  • 9bd52922bd Changed the way LDC determines if a template instantiation needs to get a definition, seems to speed up compile times quite a bit in some cases. Tomas Lindquist Olsen 2009-02-04 18:48:03 +01:00
  • a1e6510c39 Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-02-04 18:39:39 +01:00
  • c3cdcab8d2 Convert struct arg to integer when passing inreg to make sure LLVM doesn't ignore the attribute! Christian Kamm 2009-02-04 18:39:33 +01:00
  • 1e8eae2e5d Fixed warning on osx as per request from mwarning. Tomas Lindquist Olsen 2009-02-04 16:02:05 +01:00
  • 7d2a0a84a7 Removed some dead code. Fixed assertion filenames for imported template instances. Fixes #152 . Tomas Lindquist Olsen 2009-02-04 02:10:23 +01:00
  • 6cd6ddd237 Fixed an accidental code removal for osx Kelly Wilson 2009-02-03 17:27:01 -07:00
  • 584911ad4e Fixed problem with static ctors, in templated imported classes, not begin run. Fixes #203 Tomas Lindquist Olsen 2009-02-04 00:50:04 +01:00
  • bd4f7ec731 Replace assertion with errormessage for unsupported calling conventions. like Pascal. See dstress/run/e/extern_10_A.d Tomas Lindquist Olsen 2009-02-04 00:04:09 +01:00
  • 280be5ef8e Fixed dstress/run/a/array_initialization_17_A.d regression. default initialized static array elements in a constant static array initializer was getting incorrect values. Tomas Lindquist Olsen 2009-02-03 23:48:47 +01:00
  • c1aeab8c07 Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-02-03 21:46:54 +01:00
  • bbcea86cf2 Follow the D ABI and pass the last arg in a register if it is a struct that fits. Christian Kamm 2009-02-03 21:46:46 +01:00
  • 4ab57fab42 Changed this file to add 'naked' and a couple other missing instructions Kelly Wilson 2009-02-03 12:43:03 -07:00