summaryrefslogtreecommitdiffstats
path: root/lld/ELF/ScriptParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r--lld/ELF/ScriptParser.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp
index 79a46e1e09a..405de28e85e 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 == ">")
OpenPOWER on IntegriCloud