digitalmars.D.learn - determine ldc version in static if or version?
- Adam D. Ruppe (9/9) Apr 01 2020 I want to do like
- Nicholas Wilson (14/23) Apr 01 2020 https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.d...
- Adam D. Ruppe (2/3) Apr 01 2020 ah excellent that will do. thanks!
- Arine (7/11) Apr 02 2020 Not sure if that is what you are looking for. You can build the
I want to do like static if(__LDC_VERSION == 1.19) { // declaration } All the tricks I know that I have tried so far give the dmd numbers. Perhaps I could use that to identify a particular version as a hack, but I specifically am curious about the ldc version because of a change they made there independently of D. Is there something I don't know about?
Apr 01 2020
On Wednesday, 1 April 2020 at 21:19:54 UTC, Adam D. Ruppe wrote:I want to do like static if(__LDC_VERSION == 1.19) { // declaration } All the tricks I know that I have tried so far give the dmd numbers. Perhaps I could use that to identify a particular version as a hack, but I specifically am curious about the ldc version because of a change they made there independently of D. Is there something I don't know about?https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L22-L34 version (LDC_LLVM_309) enum LLVM_version = 309; else version (LDC_LLVM_400) enum LLVM_version = 400; else version (LDC_LLVM_500) enum LLVM_version = 500; else version (LDC_LLVM_600) enum LLVM_version = 600; else version (LDC_LLVM_700) enum LLVM_version = 700; else version (LDC_LLVM_701) enum LLVM_version = 701; else version (LDC_LLVM_800) enum LLVM_version = 800; else version (LDC_LLVM_900) enum LLVM_version = 900; else version (LDC_LLVM_1000) enum LLVM_version = 1000; else version (LDC_LLVM_1100) enum LLVM_version = 1100; else static assert(false, "LDC LLVM version not supported"); enum LLVM_atleast(int major) = (LLVM_version >= major * 100);
Apr 01 2020
On Thursday, 2 April 2020 at 01:27:26 UTC, Nicholas Wilson wrote:https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L22-L34ah excellent that will do. thanks!
Apr 01 2020
On Thursday, 2 April 2020 at 01:35:42 UTC, Adam D. Ruppe wrote:On Thursday, 2 April 2020 at 01:27:26 UTC, Nicholas Wilson wrote:Not sure if that is what you are looking for. You can build the latest LDC with LLVM 6.0, which would have the version be 600. So for different distros they might just the version of LLVM that's already installed. Unless the change you trying to detect is caused by a specific version of LLVM?https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L22-L34ah excellent that will do. thanks!
Apr 02 2020