Skip to content

Commit 720b7b5

Browse files
committed
Fix getBitWidthValue compilation error on LLVM 20+
Introduced by upstream in llvm/llvm-project#122289 Ref: iovisor/bcc#5194
1 parent b201e40 commit 720b7b5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

c2rust-ast-exporter/src/AstExporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,8 +2213,12 @@ class TranslateASTVisitor final
22132213

22142214
// 2. Encode bitfield width if any
22152215
if (D->isBitField()) {
2216+
#if LLVM_VERSION_MAJOR >= 20
2217+
cbor_encode_uint(array, D->getBitWidthValue());
2218+
#else
22162219
cbor_encode_uint(
22172220
array, D->getBitWidthValue(*this->Context));
2221+
#endif
22182222
} else {
22192223
cbor_encode_null(array);
22202224
};

0 commit comments

Comments
 (0)