This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Emit negated integers directly as constants
AbandonedPublic

Authored by tbaeder on Nov 4 2022, 1:18 AM.

Diff Detail

Event Timeline

tbaeder created this revision.Nov 4 2022, 1:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2022, 1:18 AM
tbaeder requested review of this revision.Nov 4 2022, 1:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 4 2022, 1:18 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This is missing test coverage (possibly around integer promotion behavior as well).

clang/lib/AST/Interp/ByteCodeExprGen.cpp
1525

Are you sure about IsUnsigned? http://eel.is/c++draft/expr.unary.op#8 reads to me like -0ULL will remain unsigned as a result.

tbaeder abandoned this revision.Nov 23 2022, 4:15 AM

This was just to make the byte code a little more readable, but given the amount of pending patches I already have, I'll abandon this and maybe revisit at a later point, thanks!