[lld] r299518 - Inline leftShift and rightShift. NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 22:40:01 PDT 2017


Author: ruiu
Date: Wed Apr  5 00:40:01 2017
New Revision: 299518

URL: http://llvm.org/viewvc/llvm-project?rev=299518&view=rev
Log:
Inline leftShift and rightShift. NFC.

Modified:
    lld/trunk/ELF/ScriptParser.cpp

Modified: lld/trunk/ELF/ScriptParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ScriptParser.cpp?rev=299518&r1=299517&r2=299518&view=diff
==============================================================================
--- lld/trunk/ELF/ScriptParser.cpp (original)
+++ lld/trunk/ELF/ScriptParser.cpp Wed Apr  5 00:40:01 2017
@@ -142,14 +142,6 @@ static ExprValue div(ExprValue A, ExprVa
   return 0;
 }
 
-static ExprValue leftShift(ExprValue A, ExprValue B) {
-  return A.getValue() << B.getValue();
-}
-
-static ExprValue rightShift(ExprValue A, ExprValue B) {
-  return A.getValue() >> B.getValue();
-}
-
 static ExprValue bitAnd(ExprValue A, ExprValue B) {
   moveAbsRight(A, B);
   return {A.Sec, A.ForceAbsolute,
@@ -708,9 +700,9 @@ static Expr combine(StringRef Op, Expr L
   if (Op == "-")
     return [=] { return sub(L(), R()); };
   if (Op == "<<")
-    return [=] { return leftShift(L(), R()); };
+    return [=] { return L().getValue() << R().getValue(); };
   if (Op == ">>")
-    return [=] { return rightShift(L(), R()); };
+    return [=] { return L().getValue() >> R().getValue(); };
   if (Op == "<")
     return [=] { return L().getValue() < R().getValue(); };
   if (Op == ">")




More information about the llvm-commits mailing list