From 4dc0eb36e64cb63e7a58643252ec472dab7f39af Mon Sep 17 00:00:00 2001 From: fairyfar Date: Thu, 10 Mar 2022 21:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=ADLLVM=5FMAJOR=5FVERSION?= =?UTF-8?q?=E5=AE=8F=E5=AE=9A=E4=B9=89=E4=B8=BA=E7=A9=BA=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/include/codegen/gscodegen.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/include/codegen/gscodegen.h b/src/include/codegen/gscodegen.h index 6bee38367..d26efb5ac 100644 --- a/src/include/codegen/gscodegen.h +++ b/src/include/codegen/gscodegen.h @@ -155,17 +155,22 @@ #ifdef ENABLE_LLVM_COMPILE /* The whole intrinsic methods are listed in include/llvm/IR/IntrinsicEnums.inc */ -#if LLVM_MAJOR_VERSION == 10 +#ifdef LLVM_MAJOR_VERSION + +#if (LLVM_MAJOR_VERSION - LLVM_MAJOR_VERSION -1 == 1) +#error LLVM version was defined as empty. +#else +#if (LLVM_MAJOR_VERSION == 10) const int llvm_prefetch = 217; const int llvm_sadd_with_overflow = 229; const int llvm_smul_with_overflow = 236; const int llvm_ssub_with_overflow = 241; -#elif LLVM_MAJOR_VERSION == 11 +#elif (LLVM_MAJOR_VERSION == 11) const int llvm_prefetch = 225; const int llvm_sadd_with_overflow = 239; const int llvm_smul_with_overflow = 247; const int llvm_ssub_with_overflow = 252; -#elif LLVM_MAJOR_VERSION == 12 +#elif (LLVM_MAJOR_VERSION == 12) const int llvm_prefetch = 225; const int llvm_sadd_with_overflow = 240; const int llvm_smul_with_overflow = 250; @@ -173,6 +178,11 @@ const int llvm_ssub_with_overflow = 256; #else #error Un-supported LLVM version. #endif +#endif + +#else +#error LLVM version is not defined. +#endif /* * Declare related LLVM classes to avoid namespace pollution.