Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions llvm/lib/Support/APFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3262,9 +3262,8 @@ bool IEEEFloat::convertFromStringSpecials(StringRef str) {
return true;
}

bool IsNegative = str.front() == '-';
bool IsNegative = str.consume_front("-");
if (IsNegative) {
str = str.drop_front();
if (str.size() < MIN_NAME_SIZE)
return false;

Expand All @@ -3275,16 +3274,13 @@ bool IEEEFloat::convertFromStringSpecials(StringRef str) {
}

// If we have a 's' (or 'S') prefix, then this is a Signaling NaN.
bool IsSignaling = str.front() == 's' || str.front() == 'S';
bool IsSignaling = str.consume_front_insensitive("s");
if (IsSignaling) {
str = str.drop_front();
if (str.size() < MIN_NAME_SIZE)
return false;
}

if (str.starts_with("nan") || str.starts_with("NaN")) {
str = str.drop_front(3);

if (str.consume_front("nan") || str.consume_front("NaN")) {
// A NaN without payload.
if (str.empty()) {
makeNaN(IsSignaling, IsNegative);
Expand Down
4 changes: 1 addition & 3 deletions llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1632,10 +1632,8 @@ SPIRVType *SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(
auto SpirvTy = getOrCreateSPIRVType(Ty, MIRBuilder, AQ, false, true);

// Handle "type*" or "type* vector[N]".
if (TypeStr.starts_with("*")) {
if (TypeStr.consume_front("*"))
SpirvTy = getOrCreateSPIRVPointerType(Ty, MIRBuilder, SC);
TypeStr = TypeStr.substr(strlen("*"));
}

// Handle "typeN*" or "type vector[N]*".
bool IsPtrToVec = TypeStr.consume_back("*");
Expand Down
Loading