[lld] r298252 - Inline a few functions.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 07:35:41 PDT 2017


Author: rafael
Date: Mon Mar 20 09:35:41 2017
New Revision: 298252

URL: http://llvm.org/viewvc/llvm-project?rev=298252&view=rev
Log:
Inline a few functions.

I don't foresee having to makes these functions any stricter or
fancier, so it probably makes sense to inline them.

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=298252&r1=298251&r2=298252&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Mon Mar 20 09:35:41 2017
@@ -96,24 +96,6 @@ static ExprValue leftShift(ExprValue A,
 static ExprValue rightShift(ExprValue A, ExprValue B) {
   return A.getValue() >> B.getValue();
 }
-static ExprValue lessThan(ExprValue A, ExprValue B) {
-  return A.getValue() < B.getValue();
-}
-static ExprValue greaterThan(ExprValue A, ExprValue B) {
-  return A.getValue() > B.getValue();
-}
-static ExprValue greaterThanOrEqual(ExprValue A, ExprValue B) {
-  return A.getValue() >= B.getValue();
-}
-static ExprValue lessThanOrEqual(ExprValue A, ExprValue B) {
-  return A.getValue() <= B.getValue();
-}
-static ExprValue equal(ExprValue A, ExprValue B) {
-  return A.getValue() == B.getValue();
-}
-static ExprValue notEqual(ExprValue A, ExprValue B) {
-  return A.getValue() != B.getValue();
-}
 static ExprValue bitAnd(ExprValue A, ExprValue B) {
   moveAbsRight(A, B);
   return {A.Sec, A.ForceAbsolute,
@@ -1674,17 +1656,17 @@ static Expr combine(StringRef Op, Expr L
   if (Op == ">>")
     return [=] { return rightShift(L(), R()); };
   if (Op == "<")
-    return [=] { return lessThan(L(), R()); };
+    return [=] { return L().getValue() < R().getValue(); };
   if (Op == ">")
-    return [=] { return greaterThan(L(), R()); };
+    return [=] { return L().getValue() > R().getValue(); };
   if (Op == ">=")
-    return [=] { return greaterThanOrEqual(L(), R()); };
+    return [=] { return L().getValue() >= R().getValue(); };
   if (Op == "<=")
-    return [=] { return lessThanOrEqual(L(), R()); };
+    return [=] { return L().getValue() <= R().getValue(); };
   if (Op == "==")
-    return [=] { return ::equal(L(), R()); };
+    return [=] { return L().getValue() == R().getValue(); };
   if (Op == "!=")
-    return [=] { return notEqual(L(), R()); };
+    return [=] { return L().getValue() != R().getValue(); };
   if (Op == "&")
     return [=] { return bitAnd(L(), R()); };
   if (Op == "|")




More information about the llvm-commits mailing list