Skip to content

Commit 54db162

Browse files
committed
Revert "[clang][bytecode] Handle bitcasts involving bitfields (#116843)"
This reverts commit 4b5e7fa. This breaks builders: https://lab.llvm.org/buildbot/#/builders/154/builds/8464 I guess some more testing on 32 bit hosts is needed.
1 parent 52b9d0b commit 54db162

File tree

10 files changed

+260
-857
lines changed

10 files changed

+260
-857
lines changed

clang/lib/AST/ByteCode/BitcastBuffer.cpp

Lines changed: 0 additions & 95 deletions
This file was deleted.

clang/lib/AST/ByteCode/BitcastBuffer.h

Lines changed: 0 additions & 88 deletions
This file was deleted.

clang/lib/AST/ByteCode/Boolean.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ class Boolean final {
8282
Boolean truncate(unsigned TruncBits) const { return *this; }
8383

8484
static Boolean bitcastFromMemory(const std::byte *Buff, unsigned BitWidth) {
85-
// Just load the first byte.
85+
// Boolean width is currently always 8 for all supported targets. If this
86+
// changes we need to get the bool width from the target info.
87+
assert(BitWidth == 8);
8688
bool Val = static_cast<bool>(*Buff);
8789
return Boolean(Val);
8890
}

clang/lib/AST/ByteCode/Integral.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ template <unsigned Bits, bool Signed> class Integral final {
183183
}
184184

185185
Integral truncate(unsigned TruncBits) const {
186-
assert(TruncBits >= 1);
187186
if (TruncBits >= Bits)
188187
return *this;
189188
const ReprT BitMask = (ReprT(1) << ReprT(TruncBits)) - 1;

0 commit comments

Comments
 (0)