Remove destructor from IRFunction#214
Remove destructor from IRFunction#214maximecb merged 1 commit intohiggsjs:masterfrom JinShil:fix_for_destroy
Conversation
|
Destructors reinitialize instances? That sounds like a terrible design choice. I will approve the PR since the destructor is not needed. Guess I should have stuck more closely to the YAGNI principle ;) |
Not destructors, but the We'd appreciate alternatives, and this is the right time to propose them (with dlang/druntime#2126). Somewhat ironically relative to the remark, the proposed semantics do less/minimal reinitialization post destruction. It's limited to cases like this: struct A {
~this() { ... }
}
void fun() {
A a;
...
destroy(a);
}Following the call to Another (probably more common) case is that some code calls To improve on situations like this, |
@andralex is proposing a change to D's
destroyimplementation at dlang/druntime#2126The new semantics re-initialize an instance if it has a user-defined destructor. This breaks Higgs as shown in the output of D's Jenkins CI (https://ci.dlang.io/blue/organizations/jenkins/dlang-org%2Fdruntime/detail/PR-2126/1/pipeline/235)
Since
IRFunction's destructor does nothing, I think it is safe to delete, regardless of whether @andralex's proposed implementation ofdestroyis accepted or not. And, D will be able to continue to test compatibility with Higgs in its CI.cc @maximecb @sbstp