Hi hackers,

My local build of master started failing last night with this error:

llvmjit_inline.cpp:59:10: fatal error: 'llvm/IR/CallSite.h' file not found
#include <llvm/IR/CallSite.h>
         ^~~~~~~~~~~~~~~~~~~~

I searched my inbox and the archive, strange that nobody else is seeing
this.

Turns out that LLVM has recently removed "llvm/IR/CallSite.h" in
(unreleased) version 11 [1][2]. To fix the build I tried conditionally
(on LLVM_VERSION_MAJOR < 11) including CallSite.h, but that looks yuck.
Then I poked at llvmjit_inline.cpp a bit and found that CallSite.h
doesn't seem to be really necessary. PFA a patch that simply removes
this #include.

In addition, I've done the due dilligence of trying to build against
LLVM versions 8, 9, 10.

Cheers,
Jesse

[1] LLVM Differential Revision: https://reviews.llvm.org/D78794
[2] LLVM commit https://github.com/llvm/llvm-project/commit/2c24051bacd2
"[CallSite removal] Rename CallSite.h to AbstractCallSite.h. NFC"
From 27084a0ebd37176f0a831042457e27cad8ac70eb Mon Sep 17 00:00:00 2001
From: Jesse Zhang <sbje...@gmail.com>
Date: Sat, 25 Apr 2020 16:24:33 -0700
Subject: [PATCH] Remove unused include

LLVM has recently removed "llvm/IR/CallSite.h" in (unreleased) version
11 [1]. Instead of using preprocessor conditionals, just remove it
because it doesn't seem like AbstractCallSite (or none of the other
symbols declared in the header) is used by LLVM JIT.

[1] LLVM Differential Revision: https://reviews.llvm.org/D78794
---
 src/backend/jit/llvm/llvmjit_inline.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/backend/jit/llvm/llvmjit_inline.cpp b/src/backend/jit/llvm/llvmjit_inline.cpp
index 95d4d854f43..2617a461cad 100644
--- a/src/backend/jit/llvm/llvmjit_inline.cpp
+++ b/src/backend/jit/llvm/llvmjit_inline.cpp
@@ -56,7 +56,6 @@ extern "C"
 #include <llvm/Support/Error.h>
 #endif
 #include <llvm/IR/Attributes.h>
-#include <llvm/IR/CallSite.h>
 #include <llvm/IR/DebugInfo.h>
 #include <llvm/IR/IntrinsicInst.h>
 #include <llvm/IR/IRBuilder.h>
-- 
2.26.2

Reply via email to