Reverse parameter order of xopCmp to match extern(C) ABI#7561
Reverse parameter order of xopCmp to match extern(C) ABI#7561ibuclaw wants to merge 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @ibuclaw! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
|
Hmm that's interesting, all tests pass. I'll have to dig up the original patch which reversed these arguments. Because something should have broke. |
|
IIRC it was the sort property, which may mean that some test was removed that validates this particular call works. |
|
Yep, test was removed (test 5854) in #6827. |
|
Re-added test which validates the call to compiler-generated Now it should fail unless the druntime PR is pulled - however will check this against gdc first. |
|
So this is a rebase of #5232. |
|
@kinke - right, I missed that. I wrote this independently, but will have a look at yours. |
|
It appears to be exactly the same minus a few comments of mine and plus your test. ;) IIRC, this approach doesn't work for LDC on 32-bit x86. A method The real problem is that a function pointer is used to invoke either an |
Right, but you would have the same problem calling a nested function from a delegate, then using that same delegate to call a method also. As I said in the other PR, I've chosen to ignore supporting |
|
As this isn't about |
|
There is no special Windows ABI, unless you mean the non-standard optlink calling convention that DMD unfavourably implements, which would be better off being dropped altogether. You shouldn't support that in LDC either. |
|
Don't know if it's Optlink specific, but it's D's official ABI for Win32 (https://dlang.org/spec/abi.html#function_calling_conventions) and as such also implemented by LDC (for all 32-bit x86 platforms, most likely because that's what inline assembly in druntime/Phobos expects...). Anyway, I just wanted to emphasize that the revived changes most likely still don't work for DMD on Win32 as long as that ABI isn't ditched, and that something like the enforced static function would be required in the meantime. |
The similarities are too uncanny for it to be a coincidence. https://dlang.org/spec/abi.html#function_calling_conventions |
|
(rebased) |
|
(rebased) |
I've never heard of IBM's "optlink" convention, and it has nothing to do with our Optlink linker. A linker does not define a calling convention anyway. The win32 calling convention goes back to Microsoft's C++ compiler on win32. I tried to be compatible with it. |
Probably because the test cases do not have side effects in the arguments, so reversing the order of non-existent side effects will have no effect. |
|
@ibuclaw : Do you want to pursue this now that GDC is up to date with master ? |
|
Ping @ibuclaw |
Well I still need to patch dmd to reverse the arguments. I assume ldc is the same too. |
|
Superseded by #13590 |
Required to support dlang/druntime#2025 (and tests will fail until it is pulled also).