aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/FileCheck/FileCheck.cpp')
-rw-r--r--llvm/lib/FileCheck/FileCheck.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/FileCheck/FileCheck.cpp b/llvm/lib/FileCheck/FileCheck.cpp
index ebebe05..f02e630 100644
--- a/llvm/lib/FileCheck/FileCheck.cpp
+++ b/llvm/lib/FileCheck/FileCheck.cpp
@@ -146,14 +146,11 @@ ExpressionFormat::valueFromStringRepr(StringRef StrVal,
bool Hex = Value == Kind::HexUpper || Value == Kind::HexLower;
uint64_t UnsignedValue;
bool MissingFormPrefix = AlternateForm && !StrVal.consume_front("0x");
+ (void)MissingFormPrefix;
+ assert(!MissingFormPrefix && "missing alternate form prefix");
if (StrVal.getAsInteger(Hex ? 16 : 10, UnsignedValue))
return ErrorDiagnostic::get(SM, StrVal, IntegerParseErrorStr);
- // Error out for a missing prefix only now that we know we have an otherwise
- // valid integer. For example, "-0x18" is reported above instead.
- if (MissingFormPrefix)
- return ErrorDiagnostic::get(SM, StrVal, "missing alternate form prefix");
-
return ExpressionValue(UnsignedValue);
}