[PATCH] D31083: Inline a few functions

Rafael Ávila de Espíndola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 08:22:33 PDT 2017


rafael created this revision.

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


https://reviews.llvm.org/D31083

Files:
  ELF/LinkerScript.cpp


Index: ELF/LinkerScript.cpp
===================================================================
--- ELF/LinkerScript.cpp
+++ ELF/LinkerScript.cpp
@@ -96,24 +96,6 @@
 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,
@@ -1652,17 +1634,17 @@
   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 == "|")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31083.92149.patch
Type: text/x-patch
Size: 1943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170317/bb81d920/attachment.bin>


More information about the llvm-commits mailing list