summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2018-01-14 04:44:21 +0000
committerRui Ueyama <ruiu@google.com>2018-01-14 04:44:21 +0000
commitfe148c88da263c1dbd9df6a3cf416a7b5278d87a (patch)
tree3b7dd17e90a4403ac300fc8d014d9b66af218a96 /lld/ELF/ScriptParser.cpp
parent84d036a0d16af1ab43a02b6054e715fb4d6397e6 (diff)
downloadbcm5719-llvm-fe148c88da263c1dbd9df6a3cf416a7b5278d87a.tar.gz
bcm5719-llvm-fe148c88da263c1dbd9df6a3cf416a7b5278d87a.zip
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
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 435b3b28f4f..65d3332a85f 100644
--- a/lld/ELF/ScriptParser.cpp
+++ b/lld/ELF/ScriptParser.cpp
@@ -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")) {
OpenPOWER on IntegriCloud