Inline small functions that are used only once.
authorRui Ueyama <ruiu@google.com>
Wed, 5 Apr 2017 19:21:15 +0000 (19:21 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 5 Apr 2017 19:21:15 +0000 (19:21 +0000)
llvm-svn: 299580

lld/ELF/ScriptParser.cpp

index 874f2c7c4397e5f1243f8fb87254bf1b69d3ed77..5894ee973a399bc2b3d4d59b9ea06ff7e8c26192 100644 (file)
@@ -160,9 +160,6 @@ static ExprValue bitOr(ExprValue A, ExprValue B) {
           (A.getValue() | B.getValue()) - A.getSecAddr()};
 }
 
-static ExprValue bitNot(ExprValue A) { return ~A.getValue(); }
-static ExprValue minus(ExprValue A) { return -A.getValue(); }
-
 void ScriptParser::readDynamicList() {
   expect("{");
   readAnonymousDeclaration();
@@ -828,11 +825,11 @@ Expr ScriptParser::readPrimary() {
 
   if (Tok == "~") {
     Expr E = readPrimary();
-    return [=] { return bitNot(E()); };
+    return [=] { return ~E().getValue(); };
   }
   if (Tok == "-") {
     Expr E = readPrimary();
-    return [=] { return minus(E()); };
+    return [=] { return -E().getValue(); };
   }
 
   // Built-in functions are parsed here.