This is an archive of the discontinued LLVM Phabricator instance.

[clang][ConstExprEmitter] handle BinaryOperators that don't have signedness or overflow concerns for integrals
Needs ReviewPublic

Authored by nickdesaulniers on Aug 8 2023, 2:30 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Handles binary operators: & ^ | == !=

Check that each side evaluates to a ConstantInt then combine the
results.

We probably can reuse DataRecursiveIntBinOpEvaluator or
handleIntIntBinOp from ExprConstant.cpp for the rest, or even these
cases as well.

Link: https://github.com/ClangBuiltLinux/linux/issues/1906

Diff Detail

Event Timeline

nickdesaulniers created this revision.Aug 8 2023, 2:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 2:30 PM
nickdesaulniers requested review of this revision.Aug 8 2023, 2:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2023, 2:30 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nickdesaulniers edited the summary of this revision. (Show Details)
  • use const &
  • add link to issue tracker