summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-04-22 21:05:04 +0000
committerRui Ueyama <ruiu@google.com>2016-04-22 21:05:04 +0000
commit5fa60985cfa91a370ded6e6b4c6cd85501da6e09 (patch)
tree47561d1fbdb8e6dfd217b0162c5907b6970d987e /lld/ELF/LinkerScript.cpp
parente29a975d23f80046a005f3251b571b7ec13d7487 (diff)
downloadbcm5719-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.cpp14
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>
OpenPOWER on IntegriCloud