Skip to content

Commit fb30208

Browse files
authored
[clang][bytecode][NFC] Make Floating::bitcastToMemory const (#114777)
The other functions like this are also const.
1 parent f1c341c commit fb30208

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/AST/ByteCode/Floating.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class Floating final {
135135
return Floating(APFloat(Sem, API));
136136
}
137137

138-
void bitcastToMemory(std::byte *Buff) {
138+
void bitcastToMemory(std::byte *Buff) const {
139139
llvm::APInt API = F.bitcastToAPInt();
140140
llvm::StoreIntToMemory(API, (uint8_t *)Buff, bitWidth() / 8);
141141
}

clang/lib/AST/ByteCode/InterpBuiltinBitCast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static bool readPointerToBuffer(const Context &Ctx, const Pointer &FromPtr,
321321
// This is really just `long double` on x86, which is the only
322322
// fundamental type with padding bytes.
323323
if (T == PT_Float) {
324-
Floating &F = P.deref<Floating>();
324+
const Floating &F = P.deref<Floating>();
325325
unsigned NumBits =
326326
llvm::APFloatBase::getSizeInBits(F.getAPFloat().getSemantics());
327327
assert(NumBits % 8 == 0);

0 commit comments

Comments
 (0)