Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #229 (closed enhancement: fixed)

Opened 9 years ago

Last modified 7 years ago

D2 support

Reported by: Matt Assigned to: lindquist
Priority: major Milestone: Delay
Component: frontend (D2 only) Version: hg tip
Keywords: Cc:


- updated dmd2/ & gen/ to DMD 2.026 - including druntime


d2support.bundle (255.2 kB) - added by Matt on 03/07/09 22:21:39.
d2.diff (181.0 kB) - added by Matt on 03/08/09 14:02:49.
new clean updated patch

Change History

03/07/09 22:21:39 changed by Matt

  • attachment d2support.bundle added.

03/08/09 00:32:16 changed by fvbommel

Matt, you can't just comment out code and replace it with assert(0) if it doesn't compile with the new frontend. You need to actually figure out what it does and update it instead...

I'm talking about the array-classification code in gen/abi-x86-64.cpp, by the way. I updated it in [1054] so that it's compatible with the upgraded frontend.

Also, did you really have to make all those whitespace changes? It makes the diffs a bit hard to read...

03/08/09 14:02:49 changed by Matt

  • attachment d2.diff added.

new clean updated patch

03/08/09 14:12:14 changed by Matt

forgot to include druntime resulting patch is 2Mo ( > Trac size limit ) real patch ->

03/08/09 21:28:07 changed by fvbommel

  • You're unconditionally substituting LinkOnceAnyLinkage for LinkOnceLinkage. Besides being wrong (it should be LinkOnceODRLinkage, except in toDebug.cpp), this breaks the compile with LLVM 2.5.
    • I already fixed this in hg tip with some preprocessor and magic.
  • There's no need to add __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS to the defines manually (in CMakeLists.txt). These should already be on the command line via ${LLVM_CXXFLAGS}.
  • inifile.c and man.c have a 100% diff. Did you change line-endings? Did Walter?
  • The change to gen/dvalue.cpp seems questionable. Was that assert failing? Why?
  • Why are you introducing grammar errors in gen/linker.cpp comments by removing apostrophes? (I'd -> Id, it's -> its)
  • In that same file, you removed apostrophes from the logging of the linker command line. Those were there for a reason, in case arguments contain spaces...
  • The other change in gen/linker.cpp:
    • This has nothing to do with D2 compatibility.
    • I'm pretty sure fork, execv and waitpid are non-portable. Why use them instead of the portable LLVM ExecuteAndWait?
    • See also gen/toobj.cpp
  • The logging lines in gen/llvmhelpers.cpp shouldn't be calling ->toChars(), ->getLVal() and ->getRVal() unconditionally. They should at the very least be in an if (Logger::enabled())
    • Were these the reason for commenting out the assert in value.cpp?
  • Also in gen/llvmhelpers.cpp (hasUnalignedFields): Again, don't comment out code and replace it with an assert(0). If the Type::next field doesn't exist anymore, use Type::nextOf() instead... (Optionally, put it in a local variable since it's then called so often there)
  • In gen/toir.cpp, the "if( type->toBasetype()->ty == Tstruct ) v = DtoLoad(v);" seems very D2-specific (presumably because this is a reference there now), but would be compiled in D1 mode too. Either put it in #if DMDV2 or handle it elsewhere...
    • Is that code even right? I'm not sure when ThisExp is generated, but wouldn't that break some of the "refness"? (e.g.: Does "return &this;" work for structs?)

03/08/09 22:31:08 changed by fvbommel

The new version of the file linked to (, md5sum 2f172d765f689842ec4f475a28c3dccf) looks okay to me, but I didn't look very closely at the frontend changes. Anyone else have any comments?

05/11/09 00:02:05 changed by lindquist

  • milestone set to Delay.

Matt, I'm very sorry that this was never committed. I should have never encouraged you to spend time on these changesets as I was in the process of a major changeset at the same time...

I don't think we'll be focusing on D2 for LDC for a while, but this should still be useful as an intermediate step when updating to a later frontend version, when that day comes (if it does).

Again I'm really sorry :( I've removed the notes about D2 from the wiki and irc topic, to hopefully avoid this happening again in the future.

07/22/10 00:28:52 changed by Trass3r

Is this issue still effective? revision log states the frontend has already been updated to 2.032?!

09/13/10 05:17:48 changed by debio

Does the frontend support version 2?

04/25/11 16:00:25 changed by mwarning

  • status changed from new to closed.
  • resolution set to fixed.

ldc now supports D2 :)

Copyright © 2008, LDC Development Team.