[lld] r267219 - Inline getInteger as it's too short to be a function. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 14:05:04 PDT 2016
Author: ruiu
Date: Fri Apr 22 16:05:04 2016
New Revision: 267219
URL: http://llvm.org/viewvc/llvm-project?rev=267219&view=rev
Log:
Inline getInteger as it's too short to be a function. NFC.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=267219&r1=267218&r2=267219&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Apr 22 16:05:04 2016
@@ -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>::parsePrimar
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>
More information about the llvm-commits
mailing list