Skip to content

Commit 7735172

Browse files
committed
Add more info to assertions
1 parent f245dbd commit 7735172

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/AST/ByteCode/Boolean.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ class Boolean final {
8282
Boolean truncate(unsigned TruncBits) const { return *this; }
8383

8484
static Boolean bitcastFromMemory(const std::byte *Buff, unsigned BitWidth) {
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.
8587
assert(BitWidth == 8);
8688
bool Val = static_cast<bool>(*Buff);
8789
return Boolean(Val);

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6426,7 +6426,7 @@ bool Compiler<Emitter>::emitBuiltinBitCast(const CastExpr *E) {
64266426
QualType ToType = E->getType();
64276427
std::optional<PrimType> ToT = classify(ToType);
64286428

6429-
assert(!DiscardResult && "Implement");
6429+
assert(!DiscardResult && "Implement DiscardResult mode for bitcasts.");
64306430

64316431
if (ToType->isNullPtrType()) {
64326432
if (!this->discard(SubExpr))
@@ -6449,7 +6449,7 @@ bool Compiler<Emitter>::emitBuiltinBitCast(const CastExpr *E) {
64496449

64506450
if (!ToT || ToT == PT_Ptr) {
64516451
// Conversion to an array or record type.
6452-
assert(false && "Implement");
6452+
assert(false && "Implement bitcast to pointers.");
64536453
}
64546454
assert(ToT);
64556455

0 commit comments

Comments
 (0)