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

Commit6a5c0bb

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 parent453be7d commit6a5c0bb

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

@@ -135,4 +137,5 @@ extern char *LLVMGetHostCPUFeatures(void);
135137
}/* extern "C" */
136138
#endif
137139

140+
#endif/* USE_LLVM */
138141
#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,16 @@
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"jit/llvmjit.h"
21+
1522

1623
/*
1724
* Emit a non-LLVM pointer as an LLVM constant.
@@ -208,4 +215,6 @@ l_mcxt_switch(LLVMModuleRef mod, LLVMBuilderRef b, LLVMValueRef nc)
208215

209216
returnret;
210217
}
218+
219+
#endif/* USE_LLVM */
211220
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp