!1556 优雅地判断LLVM_MAJOR_VERSION宏定义为空还是数值

Merge pull request !1556 from fairyfar/master
This commit is contained in:
opengauss-bot 2022-03-16 01:58:32 +00:00 committed by Gitee
commit 7997a8cf86
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 13 additions and 3 deletions

View File

@ -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.