Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix llvm20 compilation error #5194

Merged
merged 1 commit into from
Jan 19, 2025
Merged

Fix llvm20 compilation error #5194

merged 1 commit into from
Jan 19, 2025

Conversation

yonghong-song
Copy link
Collaborator

@yonghong-song yonghong-song commented Jan 18, 2025

The following is the error message:

/home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc: In member function
     ‘bool ebpf::BTypeVisitor::VisitBinaryOperator(clang::BinaryOperator*)’:
/home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc:1383:64: error:
     no matching function for call to ‘clang::FieldDecl::getBitWidthValue(clang::ASTContext&)’
 1383 |             uint64_t sz = F->isBitField() ? F->getBitWidthValue(C) : C.getTypeSize(F->getType());
      |                                             ~~~~~~~~~~~~~~~~~~~^~~

This is due to upstream llvm patch:
llvm/llvm-project#122289
This patch fixed the above compilation error.

The following is the error message:

/home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc: In member function
     ‘bool ebpf::BTypeVisitor::VisitBinaryOperator(clang::BinaryOperator*)’:
/home/yhs/work/bcc/src/cc/frontends/clang/b_frontend_action.cc:1383:64: error:
     no matching function for call to ‘clang::FieldDecl::getBitWidthValue(clang::ASTContext&)’
 1383 |             uint64_t sz = F->isBitField() ? F->getBitWidthValue(C) : C.getTypeSize(F->getType());
      |                                             ~~~~~~~~~~~~~~~~~~~^~~

This patch fixed the above compilation error.

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
@yonghong-song yonghong-song merged commit 1832c03 into master Jan 19, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant