aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/jit/llvmjit.h9
-rw-r--r--src/include/jit/llvmjit_emit.h9
2 files changed, 15 insertions, 3 deletions
diff --git a/src/include/jit/llvmjit.h b/src/include/jit/llvmjit.h
index c81cff8a35f..94e6612823b 100644
--- a/src/include/jit/llvmjit.h
+++ b/src/include/jit/llvmjit.h
@@ -11,9 +11,11 @@
#ifndef LLVMJIT_H
#define LLVMJIT_H
-#ifndef USE_LLVM
-#error "llvmjit.h should only be included by code dealing with llvm"
-#endif
+/*
+ * To avoid breaking cpluspluscheck, allow including the file even when LLVM
+ * is not available.
+ */
+#ifdef USE_LLVM
#include <llvm-c/Types.h>
@@ -135,4 +137,5 @@ extern char *LLVMGetHostCPUFeatures(void);
} /* extern "C" */
#endif
+#endif /* USE_LLVM */
#endif /* LLVMJIT_H */
diff --git a/src/include/jit/llvmjit_emit.h b/src/include/jit/llvmjit_emit.h
index 0d1b246f42a..fdc51b1e907 100644
--- a/src/include/jit/llvmjit_emit.h
+++ b/src/include/jit/llvmjit_emit.h
@@ -9,9 +9,16 @@
#ifndef LLVMJIT_EMIT_H
#define LLVMJIT_EMIT_H
+/*
+ * To avoid breaking cpluspluscheck, allow including the file even when LLVM
+ * is not available.
+ */
+#ifdef USE_LLVM
#include <llvm-c/Core.h>
+#include "jit/llvmjit.h"
+
/*
* Emit a non-LLVM pointer as an LLVM constant.
@@ -208,4 +215,6 @@ l_mcxt_switch(LLVMModuleRef mod, LLVMBuilderRef b, LLVMValueRef nc)
return ret;
}
+
+#endif /* USE_LLVM */
#endif