diff options
author | Rui Ueyama <ruiu@google.com> | 2016-04-22 21:05:04 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-04-22 21:05:04 +0000 |
commit | 5fa60985cfa91a370ded6e6b4c6cd85501da6e09 (patch) | |
tree | 47561d1fbdb8e6dfd217b0162c5907b6970d987e /lld/ELF/LinkerScript.cpp | |
parent | e29a975d23f80046a005f3251b571b7ec13d7487 (diff) | |
download | bcm5719-llvm-5fa60985cfa91a370ded6e6b4c6cd85501da6e09.tar.gz bcm5719-llvm-5fa60985cfa91a370ded6e6b4c6cd85501da6e09.zip |
Inline getInteger as it's too short to be a function. NFC.
llvm-svn: 267219
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d0b00626ba4..44246f43f9d 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -37,15 +37,6 @@ ScriptConfiguration *elf::ScriptConfig; static bool matchStr(StringRef S, StringRef T); -static uint64_t getInteger(StringRef S) { - uint64_t V; - if (S.getAsInteger(0, V)) { - error("malformed number: " + S); - return 0; - } - return V; -} - static int precedence(StringRef Op) { return StringSwitch<int>(Op) .Case("*", 4) @@ -103,7 +94,10 @@ uint64_t LinkerScript<ELFT>::parsePrimary(ArrayRef<StringRef> &Tokens) { return 0; return alignTo(Dot, V); } - return getInteger(Tok); + uint64_t V = 0; + if (Tok.getAsInteger(0, V)) + error("malformed number: " + Tok); + return V; } template <class ELFT> |