Commit Graph

  • dfea022a86 Changed array slice copying to call a runtime function when assertions or array bound checks are enabled instead of just doing a memcpy. This makes sure an exception is thrown if the copy is invalid (ie. different lengths or overlap). Fixes ticket #283 . Rebuilding the runtime is necessary. Tomas Lindquist Olsen 2009-05-10 02:23:05 +02:00
  • 54d9955abc Added reference to DMD bug for latest dstress "regressions" compile/m/mixin_29_E.d and compile/m/mixin_29_F.d . Tomas Lindquist Olsen 2009-05-10 00:50:35 +02:00
  • ecc106d7b7 Fixed dmdfe generated class invariant calls. Also insert proper "this !is null" check before it. Fixed invariant* dstress regressions and generally seems like a good idea. Hope I didn't break anything.. minitests run fine! Tomas Lindquist Olsen 2009-05-10 00:46:09 +02:00
  • 06108db87e Yet another fdiv/fsub special case. Christian Kamm 2009-05-09 20:13:05 +02:00
  • 883f13dbce Strip metadata for -singleobj as a workaround to a LLVM linking bug. Christian Kamm 2009-05-09 18:57:21 +02:00
  • cae1f425a0 Update for LLVM rev > 71348: getTypePaddedSize -> getTypeAllocSize Christian Kamm 2009-05-09 18:57:00 +02:00
  • 3aeb56abec Fixed compile unit for debug info for array operations, fixed ticket #280 . Tomas Lindquist Olsen 2009-05-09 15:27:27 +02:00
  • 81858cfc76 Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-05-09 08:58:55 +02:00
  • 968e1148d8 Restrict second arg of certain floating-point stores to ST. Fix type postfix for the two argument form of fistp and fisttp. Christian Kamm 2009-05-09 08:58:41 +02:00
  • 634d623b34 Some tweaks to -simplify-drtcalls. Frits van Bommel 2009-05-09 02:34:27 +02:00
  • 039edd5cd4 Make sure this testcase keeps crashing with -O3. Recent optimization improvements made LLVM realize the store-to-null was unavoidable, so it deleted all of main() and replaced it with 'unreachable'. Because the body of main() no longer even contained a return instruction, calling it caused random code to be ran instead. This happened to be the code that links in the ModuleInfo on my machine, which then returned "successfully". Frits van Bommel 2009-05-09 00:55:47 +02:00
  • 5b82f780f8 Allocate objects on the stack if they (a) don't have a destructor, and (b) don't override the delete operator (on top of the regular conditions for stack allocation that also apply to arrays, structs, etc.). The "no destructor" clause is not strictly necessary, but calling them at the right time would be tricky to say the least; it would involve, among other things, "manually" inserting a try-finally block around anything that might throw exceptions not caught in the current function. Frits van Bommel 2009-05-09 00:50:15 +02:00
  • adf1fd4d44 Work around an LLVM bug by not referring to globals from metadata. This was only used for consistency checking anyway. For the LLVM bug, see http://llvm.org/PR4180 / http://llvm.org/PR4046 Frits van Bommel 2009-05-08 16:00:44 +02:00
  • 5c29832ee7 Fix a bug pointed out by valgrind: OutBuffer::write4() was writing 8 bytes on platforms with 64-bit longs. Frits van Bommel 2009-05-08 12:21:53 +02:00
  • cde738111c Fix type postfix for fistp/fisttp. Two operand form still broken (is it even legal?). Christian Kamm 2009-05-07 21:49:58 +02:00
  • f5b56ce346 Fix typo in function name Frits van Bommel 2009-05-07 15:33:06 +02:00
  • b6ad8b69ab Add newline to get rid of warning. Christian Kamm 2009-05-07 21:07:50 +02:00
  • 2afbfbe8da Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-05-07 21:01:57 +02:00
  • 37edd5add6 Fix certain cases of floating point instruction mistranslation. Christian Kamm 2009-05-07 21:01:44 +02:00
  • ca4f588c08 Fixed deal breaker bug for more-at-once compilation when any module contained aggregates. Fixes ticket #272 . Tomas Lindquist Olsen 2009-05-07 02:10:29 +02:00
  • 7f07cf02ad Automated merge with http://hg.dsource.org/projects/ldc Frits van Bommel 2009-05-06 20:29:27 +02:00
  • 52c22c6c27 Stack-allocate zero-initialized arrays. Frits van Bommel 2009-05-06 20:27:48 +02:00
  • 108309a579 Ignore short/long prefix of labels instead of ignoring the whole branch instruction! Christian Kamm 2009-05-06 19:56:33 +02:00
  • c57f6212a6 Make the no-operand versions of floating point inline asm instructions always pop the floating point stack - like dmd does. Christian Kamm 2009-05-06 18:54:20 +02:00
  • 8a8818104b Translate fsub/fdiv correctly. See #256. Christian Kamm 2009-05-06 18:08:44 +02:00
  • ec573df5b2 Some refactoring Frits van Bommel 2009-05-06 15:58:15 +02:00
  • c6b6d1874a Postpone (expensive) escape analysis until we're sure it's needed. Frits van Bommel 2009-05-06 14:11:37 +02:00
  • c60ce29bde fix wrong arg order for fmul/fadd Kelly Wilson 2009-05-05 11:51:00 -06:00
  • 5723fa7492 Add 'nounwind' attribute to the relevant runtime functions, and use it when deciding whether or not to generate an invoke instead of a call. Frits van Bommel 2009-05-04 20:26:45 +02:00
  • cf0b8936ce Factor out the code to find gcc, and add a command-line option to override the default executable name. This should help cross-compilation by allowing a cross-gcc to be specified from the configuration file instead of only through the CC environment variable. Frits van Bommel 2009-05-04 13:32:16 +02:00
  • f7e54dce10 Don't forget to update the control flow when deleting an invoke. Fixes #284. Frits van Bommel 2009-05-04 12:08:30 +02:00
  • fa79329102 Stack promotion for _d_newarrayvT. Array literals, concatenations (a ~ b) and such are eligible for stack-allocation now. Frits van Bommel 2009-05-03 18:01:45 +02:00
  • a2eee70761 Add -verify-each option to ease debugging Frits van Bommel 2009-05-03 21:58:28 +02:00
  • 67fc0aca20 Remove some overly verbose debug output Frits van Bommel 2009-05-03 20:19:49 +02:00
  • 865ae79e27 Strip metadata even when addPassesForOptLevel() isn't called, for instance when only inlining or when manually specifying passes. Frits van Bommel 2009-05-03 20:16:15 +02:00
  • 3572944b90 Remove bogus noalias attribute from _d_arraysetlength[i]T. Frits van Bommel 2009-05-03 15:24:05 +02:00
  • 77100f890c Make static int[] a = [1, 2]; a[0] = 4; not segfault by making the array data ptr a non-const global variable. Christian Kamm 2009-05-03 11:16:54 +02:00
  • c831367b24 Factor out some constants into the header so producers and consumers of metadata stay in sync (and are more readable). Frits van Bommel 2009-05-02 20:42:58 +02:00
  • 2b18460169 Force SVN to C locale Benjamin Kramer 2009-05-02 14:00:57 +02:00
  • 0cc01f160f Add runtime support for darwin x86_64 Benjamin Kramer 2009-05-02 16:39:26 +02:00
  • 87d960c29a Fix build when USE_METADATA is off. Matti Niemenmaa 2009-05-02 19:03:33 +03:00
  • 262ef97945 There's an issue with LLVM metadata support; it triggers an assert when trying to generate asm for code with metadata globals. This new pass is used as a workaround: it strips metadata from the module before it reaches the code generator. Obviously, this is disabled if LLVM doesn't support metadata. Frits van Bommel 2009-05-02 12:19:43 +02:00
  • 34955bcbf9 Remove calls to some runtime functions if their results are unused Frits van Bommel 2009-05-02 11:58:50 +02:00
  • cff0f1f446 Implement another D-specific pass: -dgc2stack This one promotes GC allocations to stack memory when it can determine it's safe to do so. Not all GC calls are recognized yet (in fact only one *is* recognized for now). Needs metadata, so disabled for LLVM versions that don't support it. Frits van Bommel 2009-05-02 11:58:50 +02:00
  • a9c518d82b Add metadata for TypeInfo -> llvm::Type mapping. Disabled for LLVM versions before the introduction of metadata. Frits van Bommel 2009-05-02 11:58:50 +02:00
  • 6c91185a77 Remove some dead code. Frits van Bommel 2009-05-02 11:58:50 +02:00
  • 9812a8c8ae Commit workaround for TypeFunction comparing issue. Christian Kamm 2009-04-30 23:16:21 +02:00
  • da4450d2f5 Make sure this still compiles after LLVM r70437, which introduces a specialization for command-line option template parser<char> which does the wrong thing for us... Frits van Bommel 2009-04-30 12:25:04 +02:00
  • 96108f8e7c Now the backend wants an enum value as optimization level. Hopefully this'll be the last change to that code... Frits van Bommel 2009-04-30 11:56:03 +02:00
  • ca39bb4f4d Fixed array operation codegen when used from imported templates. All array operations are now emitted with template linkage. Fixed #270 . Tomas Lindquist Olsen 2009-04-29 18:59:39 +02:00
  • 617861ead4 Fixed file name in imported mixins containing assertions. Tomas Lindquist Olsen 2009-04-29 18:39:59 +02:00
  • b6a6391116 Add some attributes to runtime calls, to provide the standard LLVM optimization passes with more information. Frits van Bommel 2009-04-29 17:47:24 +02:00
  • b9849d86b6 Update codegen to (hopefully) work correctly with newer LLVM trunk, where there's no longer a Fast flag. (It has been replaced by an optimization level) Untested because I haven't compiled that recent an LLVM yet :). Frits van Bommel 2009-04-29 10:26:28 +02:00
  • 0df1e34eb2 Implement first D-specific optimization pass: -simplify-drtcalls. It uses the machinery of the standard -simplify-libcalls pass, but optimizes calls to the D runtime instead of calls to C libraries. Frits van Bommel 2009-04-28 21:58:06 +02:00
  • f712c48312 Check in some old changes to the binding, from before I had commit access. - Add bindings for InsertValue and ExtractValue - Updates to use new APIs where they were renamed or removed. - Add generic error messages if LLVM didn't provide one. - Enable typesafe variadic arguments for GetGEP. Frits van Bommel 2009-04-27 22:34:36 +02:00
  • e3b8cb29ea Committing LLVM binding for D as it currently exists in the SVN repository. Frits van Bommel 2009-04-27 22:33:17 +02:00
  • f290ff0530 Forgot the special case part in last !ThisExp change. Tomas Lindquist Olsen 2009-04-27 13:59:15 +02:00
  • 95b94935ee Moved special casing of 'assert(this, "null this");' generated statements from !ThisExp into !AssertExp. Tomas Lindquist Olsen 2009-04-27 13:30:48 +02:00
  • ba38e15f0d Fixed class default initializers and type generation. Bug #260 is fixed. Tomas Lindquist Olsen 2009-04-27 03:40:40 +02:00
  • 3bd5cf70c2 Added testcase for overlapping struct default initializer I has missed. Slight tweak of the relevant error message. Tomas Lindquist Olsen 2009-04-27 01:43:29 +02:00
  • 664c2c333e Remove a bit of code duplication. Frits van Bommel 2009-04-26 20:36:53 +02:00
  • 5d63aeaed9 Fix a logic bug. Frits van Bommel 2009-04-26 20:31:48 +02:00
  • 17dbddfe41 Force 'fast' compilation when debug info is requested. LLVM trunk seems to skip debug info for non-fast compilation. Christian Kamm 2009-04-26 18:21:07 +02:00
  • 5b71e2ef81 Fix interface indices. Closes #269 and #266. Christian Kamm 2009-04-26 11:29:30 +02:00
  • c6b059ed73 Add (currently failing) test for correct virtual call resolution. Christian Kamm 2009-04-26 10:29:39 +02:00
  • 73f93d7240 Merge Tomas Lindquist Olsen 2009-04-25 18:27:11 +02:00
  • 3e882d422b Fixed struct default initializers. Tomas Lindquist Olsen 2009-04-25 18:26:54 +02:00
  • 8916f783b7 Revert change to treat bodyless functions in abstract classes as abstract. See DMD bug 2894. Christian Kamm 2009-04-25 09:11:32 +02:00
  • 83dda319ae Add #include "gen/llvm-version.h" to files that use the macro it defines... Frits van Bommel 2009-04-24 16:47:42 +02:00
  • 0485196ae8 Fix parsing of import statements to only pass valid identifiers to Import constructor. Fixes #264. Christian Kamm 2009-04-23 20:44:55 +02:00
  • a38d34dead Trivial fix for bug #265 Christian Kamm 2009-04-23 20:28:29 +02:00
  • d21cdb1df0 Changes for mingw to compile properly Kelly Wilson 2009-04-22 14:49:49 -06:00
  • 5c4455a394 Change needed for mingw Kelly Wilson 2009-04-22 14:40:56 -06:00
  • 687395cda6 Rewrote runtime struct literal codegen. Tomas Lindquist Olsen 2009-04-22 03:08:28 +02:00
  • f6f12e4241 Added checks for overlapping union initializers, as shown in bug #259 . Tomas Lindquist Olsen 2009-04-22 01:18:21 +02:00
  • 575038bfbd Fixed classinfo.interfaces for .. interfaces! Tomas Lindquist Olsen 2009-04-21 20:19:53 +02:00
  • 4567a55f7f Fixed emitting declarations nested inside interfaces. Tomas Lindquist Olsen 2009-04-21 19:32:22 +02:00
  • f6772bd600 Add forgotten null check. Christian Kamm 2009-04-21 19:17:29 +02:00
  • 0e6364a158 Automated merge with http://hg.dsource.org/projects/ldc Christian Kamm 2009-04-21 18:57:29 +02:00
  • b3db60cbda Merge. Tomas Lindquist Olsen 2009-04-21 17:54:43 +02:00
  • 0e8216fbd6 Remove some logging I didn't mean to commit. Frits van Bommel 2009-04-20 00:04:35 +02:00
  • 21f273671a Fix a problem which occurred when a function type was forward-referenced by parameter types. Frits van Bommel 2009-04-19 23:15:03 +02:00
  • e05b960bbe No need for temporary alloca's here, use a phi node instead. Frits van Bommel 2009-04-19 19:28:10 +02:00
  • 522c580647 Do not emit declare or emit a vtbl entry for bodyless functions in abstract classes. Christian Kamm 2009-04-19 00:06:23 +02:00
  • 081efcbb7d Copy alloca'd parameters referenced by nested functions to the nesting frame. Frits van Bommel 2009-04-18 00:34:20 +02:00
  • 134870c873 Disabled resetting types between modules MAO (more at once). Fixes guaranteed MOA compilation segfault. Tomas Lindquist Olsen 2009-04-17 17:16:55 +02:00
  • 36f3161803 Merge. Tomas Lindquist Olsen 2009-04-17 14:48:37 +02:00
  • 1c79df3817 Fixed all issues preventing Tango 0.99.8 to compile with `sh build-tango.sh --verbose ldc'. Tomas Lindquist Olsen 2009-04-17 14:38:29 +02:00
  • 46565f1adc Fix nested functions. My last patch was a little over-zealous in passing undef, it always passed undef to inner functions expecting a single context frame. Frits van Bommel 2009-04-17 13:50:01 +02:00
  • 0262a6ec8f Use 'undef' instead of null for unneeded contexts. Frits van Bommel 2009-04-17 03:47:56 +02:00
  • f5ce8eda1d Resolve all base classes, including interfaces (!) before resolving the class itself. Tomas Lindquist Olsen 2009-04-17 03:01:43 +02:00
  • ea2279b11a Updated the interal runtime's ClassInfo type to match the one in object.di . Runtime now compiles and runminitest is back to normal except for typeinfo10.d . Tomas Lindquist Olsen 2009-04-17 02:54:16 +02:00
  • 3d9598d854 Merge with rev [1221] Tomas Lindquist Olsen 2009-04-17 01:19:03 +02:00
  • 33eb3133f3 Unbreak nested naked functions. Frits van Bommel 2009-04-17 01:14:35 +02:00
  • c7936c2ace !ClassInfo instances were not mutable, this is necessary for .classinfo based locking to work. !ModuleInfo generation was commented out as well. Tomas Lindquist Olsen 2009-04-17 00:54:20 +02:00
  • 9568616e66 Fixed static struct initializers. Tomas Lindquist Olsen 2009-04-17 00:36:21 +02:00
  • 803fbf4882 Make !TypeInfo output lazy unless we need to provide full definitions in general. Tomas Lindquist Olsen 2009-04-16 22:20:26 +02:00
  • e01917bc0d Make typeinfo for struct Tomas Lindquist Olsen 2009-04-16 22:19:36 +02:00
  • 8feabfc5c6 Make sure aggregates are resolved before outputting their debug info. Tomas Lindquist Olsen 2009-04-16 21:15:42 +02:00
  • 948202a1a1 Fixed ClassInfo.interfaces. mini/s.d now runs again. Tomas Lindquist Olsen 2009-04-16 21:10:51 +02:00