From 7e9155115e978c65d55ba8b0e5beef5d830e3603 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 5 Apr 2017 05:40:01 +0000 Subject: [PATCH] Inline leftShift and rightShift. NFC. llvm-svn: 299518 --- lld/ELF/ScriptParser.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index 79a46e1e09a2..405de28e85e1 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -142,14 +142,6 @@ static ExprValue div(ExprValue A, ExprValue B) { 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, Expr R) { 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 == ">")