summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-08-24 10:20:55 -0700
committerAndres Freund <andres@anarazel.de>2018-08-24 10:21:38 -0700
commitcb92520563834577d3afbbedcc0df4ee0aac3445 (patch)
tree522a20456828dc17bb65fba7f0dc2c6a32ea759e /src
parentb0c5da615ec45bcd24b97a1d55b1f489b9830a4b (diff)
downloadpostgresql-cb92520563834577d3afbbedcc0df4ee0aac3445.tar.gz
LLVMJIT: LLVMGetHostCPUFeatures now is upstream, use LLMV version if available.
Noticed thanks to buildfarm animal seawasp. Author: Andres Freund Backpatch: v11-, where LLVM based JIT compliation was introduced.
Diffstat (limited to 'src')
-rw-r--r--src/backend/jit/llvm/llvmjit_wrap.cpp2
-rw-r--r--src/include/jit/llvmjit.h2
-rw-r--r--src/include/pg_config.h.in4
-rw-r--r--src/include/pg_config.h.win324
4 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/jit/llvm/llvmjit_wrap.cpp b/src/backend/jit/llvm/llvmjit_wrap.cpp
index 5d1a17cde0..4d0c3f680f 100644
--- a/src/backend/jit/llvm/llvmjit_wrap.cpp
+++ b/src/backend/jit/llvm/llvmjit_wrap.cpp
@@ -32,6 +32,7 @@ char *LLVMGetHostCPUName(void) {
#endif
+#if defined(HAVE_DECL_LLVMGETHOSTCPUFEATURES) && !HAVE_DECL_LLVMGETHOSTCPUFEATURES
char *LLVMGetHostCPUFeatures(void) {
llvm::SubtargetFeatures Features;
llvm::StringMap<bool> HostFeatures;
@@ -42,3 +43,4 @@ char *LLVMGetHostCPUFeatures(void) {
return strdup(Features.getString().c_str());
}
+#endif
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h
index b0093db49d..c81cff8a35 100644
--- a/src/include/jit/llvmjit.h
+++ b/src/include/jit/llvmjit.h
@@ -125,9 +125,11 @@ extern LLVMValueRef slot_compile_deform(struct LLVMJitContext *context, TupleDes
extern char *LLVMGetHostCPUName(void);
#endif
+#if defined(HAVE_DECL_LLVMGETHOSTCPUFEATURES) && !HAVE_DECL_LLVMGETHOSTCPUFEATURES
/** Get the host CPU features as a string. The result needs to be disposed
with LLVMDisposeMessage. */
extern char *LLVMGetHostCPUFeatures(void);
+#endif
#ifdef __cplusplus
} /* extern "C" */
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 827574ee40..31bef2b7f5 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -142,6 +142,10 @@
`LLVMCreatePerfJITEventListener', and to 0 if you don't. */
#undef HAVE_DECL_LLVMCREATEPERFJITEVENTLISTENER
+/* Define to 1 if you have the declaration of `LLVMGetHostCPUFeatures', and to
+ 0 if you don't. */
+#undef HAVE_DECL_LLVMGETHOSTCPUFEATURES
+
/* Define to 1 if you have the declaration of `LLVMGetHostCPUName', and to 0
if you don't. */
#undef HAVE_DECL_LLVMGETHOSTCPUNAME
diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32
index 46ce49def2..436bc5f087 100644
--- a/src/include/pg_config.h.win32
+++ b/src/include/pg_config.h.win32
@@ -119,6 +119,10 @@
if you don't. */
#define HAVE_DECL_LLVMGETHOSTCPUNAME 0
+/* Define to 1 if you have the declaration of `LLVMGetHostCPUFeatures', and to 0
+ if you don't. */
+#define HAVE_DECL_LLVMGETHOSTCPUFEATURES 0
+
/* Define to 1 if you have the declaration of `LLVMOrcGetSymbolAddressIn', and
to 0 if you don't. */
#define HAVE_DECL_LLVMORCGETSYMBOLADDRESSIN 0