Revert r267132 as it broke buildbot.

llvm-svn: 267134
This commit is contained in:
George Rimar 2016-04-22 10:51:34 +00:00
parent 5b31c423a0
commit f8e230b277
3 changed files with 0 additions and 63 deletions

View File

@ -97,17 +97,6 @@ uint64_t LinkerScript<ELFT>::parsePrimary(ArrayRef<StringRef> &Tokens) {
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(ArrayRef<StringRef> &Tokens,
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);

View File

@ -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;
};

View File

@ -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