diff options
| author | Rui Ueyama <ruiu@google.com> | 2017-04-05 00:43:05 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2017-04-05 00:43:05 +0000 |
| commit | 5f20b6304b53058cbc3ea8617dfcad84226e2362 (patch) | |
| tree | a13a41ed3a4fca46ffafc43ba3736177ddfca6f1 /lld/ELF/LinkerScript.cpp | |
| parent | a08fa2eca355538b850abc6b450680253be6755d (diff) | |
| download | bcm5719-llvm-5f20b6304b53058cbc3ea8617dfcad84226e2362.tar.gz bcm5719-llvm-5f20b6304b53058cbc3ea8617dfcad84226e2362.zip | |
Add newlines.
llvm-svn: 299493
Diffstat (limited to 'lld/ELF/LinkerScript.cpp')
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 4eca9dd45ab..16f75ea7749 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -80,34 +80,42 @@ static ExprValue add(ExprValue A, ExprValue B) { moveAbsRight(A, B); return {A.Sec, A.ForceAbsolute, A.Val + B.getValue()}; } + static ExprValue sub(ExprValue A, ExprValue B) { return {A.Sec, A.Val - B.getValue()}; } + static ExprValue mul(ExprValue A, ExprValue B) { return A.getValue() * B.getValue(); } + static ExprValue div(ExprValue A, ExprValue B) { if (uint64_t BV = B.getValue()) return A.getValue() / BV; error("division by zero"); 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, (A.getValue() & B.getValue()) - A.getSecAddr()}; } + static ExprValue bitOr(ExprValue A, ExprValue B) { moveAbsRight(A, B); return {A.Sec, A.ForceAbsolute, (A.getValue() | B.getValue()) - A.getSecAddr()}; } + static ExprValue bitNot(ExprValue A) { return ~A.getValue(); } static ExprValue minus(ExprValue A) { return -A.getValue(); } |

