Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda05eb5

Browse files
committed
Fix LLVM related headers to compile standalone (to fix cpluspluscheck).
Previously llvmjit.h #error'ed when USE_LLVM was not defined, toprevent it from being included from code not having #ifdef USE_LLVMguards - but that's not actually that useful after, during thedevelopment of JIT support, LLVM related code was moved into aseparately compiled .so. Having that #error means cpluspluscheckdoesn't work when llvm support isn't enabled, which isn't great.Similarly add USE_LLVM guards to llvmjit_emit.h, and additionally makesure it compiles standalone.Per complaint from Tom Lane.Author: Andres FreundDiscussion:https://postgr.es/m/19808.1548692361@sss.pgh.pa.usBackpatch: 11, where JIT support was added
1 parent6842005 commitda05eb5

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

‎src/include/jit/llvmjit.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
#ifndefLLVMJIT_H
1212
#defineLLVMJIT_H
1313

14-
#ifndefUSE_LLVM
15-
#error "llvmjit.h should only be included by code dealing with llvm"
16-
#endif
14+
/*
15+
* To avoid breaking cpluspluscheck, allow including the file even when LLVM
16+
* is not available.
17+
*/
18+
#ifdefUSE_LLVM
1719

1820
#include<llvm-c/Types.h>
1921

@@ -140,4 +142,5 @@ extern char *LLVMGetHostCPUFeatures(void);
140142
}/* extern "C" */
141143
#endif
142144

145+
#endif/* USE_LLVM */
143146
#endif/* LLVMJIT_H */

‎src/include/jit/llvmjit_emit.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@
99
#ifndefLLVMJIT_EMIT_H
1010
#defineLLVMJIT_EMIT_H
1111

12+
/*
13+
* To avoid breaking cpluspluscheck, allow including the file even when LLVM
14+
* is not available.
15+
*/
16+
#ifdefUSE_LLVM
1217

1318
#include<llvm-c/Core.h>
1419

20+
#include"fmgr.h"
21+
#include"jit/llvmjit.h"
22+
1523

1624
/*
1725
* Emit a non-LLVM pointer as an LLVM constant.
@@ -263,4 +271,5 @@ l_funcvalue(LLVMBuilderRef b, LLVMValueRef v_fcinfo, size_t argno)
263271
returnLLVMBuildLoad(b,l_funcvaluep(b,v_fcinfo,argno),"");
264272
}
265273

274+
#endif/* USE_LLVM */
266275
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp