Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Comments

Re-add forward declaration of _d_monitordelete#964

Merged
braddr merged 1 commit intodlang:masterfrom
ibuclaw:fixsepcomp
Sep 25, 2014
Merged

Re-add forward declaration of _d_monitordelete#964
braddr merged 1 commit intodlang:masterfrom
ibuclaw:fixsepcomp

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Sep 24, 2014

Fixes bug introduced by #749

GDC compiles each module separately, unlike DMD, so gets hit by an 'undefined identifier' error. DMD doesn't get it because the private version of object.d is implicitly imported.

@braddr
Copy link
Member

braddr commented Sep 25, 2014

Auto-merge toggled on

braddr added a commit that referenced this pull request Sep 25, 2014
Re-add forward declaration of _d_monitordelete
@braddr braddr merged commit f5d542b into dlang:master Sep 25, 2014
@MartinNowak
Copy link
Member

DMD doesn't get it because the private version of object.d is implicitly imported.

So should we compile object_.d separately?

@yebblies
Copy link
Contributor

It's a weird situation, because object_.d is magic. This isn't a user-facing issue.

So should we compile object_.d separately?

If we are concerned about druntime modules compiling correctly with object.di, then we should probably compile them again object.di.

@rainers
Copy link
Member

rainers commented Sep 26, 2014

I wonder why we don't generate object.di from object_d. I tried that and compared the results:

  • imports in object_.d: these should be made local
  • other definition of size_t and ptrdiff_t (a comment in object.d says that the version in object.di does not work)
  • function attributes on the left instead of the right (I think we might want to change that in the di file generation)
  • most TypeInfo_* member overrides missing in object.di: this might cause wrong code if you derive from these and call super.method
  • different type for TypeInfo_Class.defaultConstructor
  • different return types for TypeInfo_Struct.xtoHash/xToString. Is this deliberate?
  • missing members in MemberInfo_field in object.di: deriving from this will cause errors
  • traceHandler declarations not in object.di: I guess these should be in another module anyway
  • monitor functions/declarations not in object.di: I guess these should be in another module anyway
  • event functions not in object.di: I guess these should be in another module anyway
  • unittests leave an empty declaration block if annotated with pure/nothrow: compiles, but is ugly
  • __ctfeWrite not in object.d: is this needed?
  • different declaration of RTInfo!T
  • @safe removed during conversion of '__traits(compiles, (T b) @safe { T a = b; })': bug?
  • object_d uses a.dup, object.di uses .dup(a): I remember there are subtle differences, but do these apply to const(T)[], too?

Overall I think we gain by autogenerating object.di. That would still mean that there needs to be a separate build step when compiling without object_.d.

@ibuclaw ibuclaw deleted the fixsepcomp branch September 27, 2014 12:31
@ibuclaw
Copy link
Member Author

ibuclaw commented Sep 27, 2014

If we are concerned about druntime modules compiling correctly with object.di, then we should probably compile them again object.di.

Or rely on gdc telling you your code is wrong... a couple of months after release. ;)

@yebblies
Copy link
Contributor

Or rely on gdc telling you your code is wrong... a couple of months after release. ;)

Sure, either way works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants