[lld] r267134 - Revert r267132 as it broke buildbot.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 22 03:51:35 PDT 2016
Author: grimar
Date: Fri Apr 22 05:51:34 2016
New Revision: 267134
URL: http://llvm.org/viewvc/llvm-project?rev=267134&view=rev
Log:
Revert r267132 as it broke buildbot.
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/LinkerScript.h
lld/trunk/test/ELF/linkerscript-locationcounter.s
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=267134&r1=267133&r2=267134&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Fri Apr 22 05:51:34 2016
@@ -97,17 +97,6 @@ uint64_t LinkerScript<ELFT>::parsePrimar
return getInteger(Tok);
}
-template <class ELFT>
-uint64_t LinkerScript<ELFT>::parseTernary(ArrayRef<StringRef> &Tokens,
- uint64_t Cond) {
- next(Tokens);
- uint64_t V = parseExpr(Tokens, Dot);
- if (!expect(Tokens, ":"))
- return 0;
- uint64_t W = parseExpr(Tokens, Dot);
- return Cond ? V : W;
-}
-
static uint64_t apply(StringRef Op, uint64_t L, uint64_t R) {
if (Op == "+")
return L + R;
@@ -137,9 +126,6 @@ uint64_t LinkerScript<ELFT>::parseExpr1(
while (!Tokens.empty()) {
// Read an operator and an expression.
StringRef Op1 = Tokens.front();
- if (Op1 == "?")
- return parseTernary(Tokens, Lhs, Dot);
-
if (precedence(Op1) < MinPrec)
return Lhs;
next(Tokens);
Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=267134&r1=267133&r2=267134&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Fri Apr 22 05:51:34 2016
@@ -93,7 +93,6 @@ private:
uint64_t parseExpr(ArrayRef<StringRef> &Tokens);
uint64_t parsePrimary(ArrayRef<StringRef> &Tokens);
uint64_t parseExpr1(ArrayRef<StringRef> &Tokens, uint64_t Lhs, int MinPrec);
- uint64_t parseTernary(ArrayRef<StringRef> &Tokens, uint64_t Cond);
typename ELFT::uint Dot;
};
Modified: lld/trunk/test/ELF/linkerscript-locationcounter.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/linkerscript-locationcounter.s?rev=267134&r1=267133&r2=267134&view=diff
==============================================================================
--- lld/trunk/test/ELF/linkerscript-locationcounter.s (original)
+++ lld/trunk/test/ELF/linkerscript-locationcounter.s Fri Apr 22 05:51:34 2016
@@ -14,10 +14,6 @@
# RUN: .bracket : { *(.bracket) } \
# RUN: . = 0x17000 & 0x15000; \
# RUN: .and : { *(.and) } \
-# RUN: . = 0x1 ? 0x16000 : 0x999999; \
-# RUN: .ternary1 : { *(.ternary1) } \
-# RUN: . = 0x0 ? 0x999999 : 0x17000; \
-# RUN: .ternary2 : { *(.ternary2) } \
# RUN: }" > %t.script
# RUN: ld.lld %t --script %t.script -o %t2
# RUN: llvm-readobj -s %t2 | FileCheck %s
@@ -112,36 +108,6 @@
# CHECK-NEXT: AddressAlignment:
# CHECK-NEXT: EntrySize:
# CHECK-NEXT: }
-# CHECK-NEXT: Section {
-# CHECK-NEXT: Index:
-# CHECK-NEXT: Name: .ternary1
-# CHECK-NEXT: Type: SHT_PROGBITS
-# CHECK-NEXT: Flags [
-# CHECK-NEXT: SHF_ALLOC
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x16000
-# CHECK-NEXT: Offset:
-# CHECK-NEXT: Size:
-# CHECK-NEXT: Link:
-# CHECK-NEXT: Info:
-# CHECK-NEXT: AddressAlignment:
-# CHECK-NEXT: EntrySize:
-# CHECK-NEXT: }
-# CHECK-NEXT: Section {
-# CHECK-NEXT: Index:
-# CHECK-NEXT: Name: .ternary2
-# CHECK-NEXT: Type: SHT_PROGBITS
-# CHECK-NEXT: Flags [
-# CHECK-NEXT: SHF_ALLOC
-# CHECK-NEXT: ]
-# CHECK-NEXT: Address: 0x17000
-# CHECK-NEXT: Offset:
-# CHECK-NEXT: Size:
-# CHECK-NEXT: Link:
-# CHECK-NEXT: Info:
-# CHECK-NEXT: AddressAlignment:
-# CHECK-NEXT: EntrySize:
-# CHECK-NEXT: }
## Mailformed number error.
# RUN: echo "SECTIONS { \
@@ -183,14 +149,6 @@
# RUN: FileCheck --check-prefix=DIVZERO %s
# DIVZERO: division by zero
-## Broken ternary operator expression.
-# RUN: echo "SECTIONS { \
-# RUN: . = 0x1 ? 0x2; \
-# RUN: }" > %t.script
-# RUN: not ld.lld %t --script %t.script -o %t2 2>&1 | \
-# RUN: FileCheck --check-prefix=TERNERR %s
-# TERNERR: : expected
-
.globl _start;
_start:
nop
@@ -212,9 +170,3 @@ nop
.section .and, "a"
.quad 0
-
-.section .ternary1, "a"
-.quad 0
-
-.section .ternary2, "a"
-.quad 0
More information about the llvm-commits
mailing list