Re: determine ldc version in static if or version?

2020-04-02 Thread Arine via Digitalmars-d-learn

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:

https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/intrinsics.di#L22-L34


ah excellent that will do. thanks!


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?


Re: determine ldc version in static if or version?

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn

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-L34


ah excellent that will do. thanks!



Re: determine ldc version in static if or version?

2020-04-01 Thread Nicholas Wilson via Digitalmars-d-learn

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);


determine ldc version in static if or version?

2020-04-01 Thread Adam D. Ruppe via Digitalmars-d-learn

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?