Remove dead code.

parseInt assumed that it could take a negative number literal (e.g.
"-123"). However, such number is in reality already handled as a
unary operator '-' followed by a number literal, so the number
literal is always non-negative. Thus, this code is dead.

llvm-svn: 322453
This commit is contained in:
Rui Ueyama 2018-01-14 04:44:21 +00:00
parent 84d036a0d1
commit fe148c88da
1 changed files with 0 additions and 7 deletions

View File

@ -880,13 +880,6 @@ Expr ScriptParser::readConstant() {
// "0x" or suffixed with "H") and decimal numbers. Decimal numbers may
// have "K" (Ki) or "M" (Mi) suffixes.
static Optional<uint64_t> parseInt(StringRef Tok) {
// Negative number
if (Tok.startswith("-")) {
if (Optional<uint64_t> Val = parseInt(Tok.substr(1)))
return -*Val;
return None;
}
// Hexadecimal
uint64_t Val;
if (Tok.startswith_lower("0x")) {