Skip to content

Commit

Permalink
Revert "[XCOFF][llvm-objdump] change the priority of symbols with"
Browse files Browse the repository at this point in the history
This reverts commit 2ad6621.

Buildbot failure #19373
  • Loading branch information
EsmeYi committed Feb 18, 2022
1 parent a43f7d6 commit 0bf3fec
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 51 deletions.
11 changes: 5 additions & 6 deletions llvm/include/llvm/MC/MCDisassembler/MCDisassembler.h
Expand Up @@ -46,21 +46,20 @@ struct SymbolInfoTy {
Optional<XCOFF::StorageMappingClass> Smc, Optional<uint32_t> Idx,
bool Label)
: Addr(Addr), Name(Name), XCOFFSymInfo(Smc, Idx, Label), IsXCOFF(true) {}
SymbolInfoTy(uint64_t Addr, StringRef Name, uint8_t Type,
bool IsXCOFF = false)
: Addr(Addr), Name(Name), Type(Type), IsXCOFF(IsXCOFF) {}
SymbolInfoTy(uint64_t Addr, StringRef Name, uint8_t Type)
: Addr(Addr), Name(Name), Type(Type), IsXCOFF(false) {}
bool isXCOFF() const { return IsXCOFF; }

private:
friend bool operator<(const SymbolInfoTy &P1, const SymbolInfoTy &P2) {
assert(P1.IsXCOFF == P2.IsXCOFF &&
"P1.IsXCOFF should be equal to P2.IsXCOFF.");
if (P1.IsXCOFF)
return std::tie(P1.Addr, P1.XCOFFSymInfo, P1.Type, P1.Name) <
std::tie(P2.Addr, P2.XCOFFSymInfo, P2.Type, P2.Name);
return std::tie(P1.Addr, P1.XCOFFSymInfo, P1.Name) <
std::tie(P2.Addr, P2.XCOFFSymInfo, P2.Name);

return std::tie(P1.Addr, P1.Name, P1.Type) <
std::tie(P2.Addr, P2.Name, P2.Type);
std::tie(P2.Addr, P2.Name, P2.Type);
}
};

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Object/ObjectFile.h
Expand Up @@ -170,11 +170,11 @@ class SymbolRef : public BasicSymbolRef {
public:
enum Type {
ST_Unknown, // Type not specified
ST_Other,
ST_Data,
ST_Debug,
ST_File,
ST_Function,
ST_Other
};

SymbolRef() = default;
Expand Down
Expand Up @@ -43,7 +43,7 @@ body: |
...

# DIS: Disassembly of section .text:
# DIS: 00000000 <.aix-prefixed-instruction-boundary>:
# DIS: 00000000 <.text>:
# DIS-NEXT: 0: 38 60 00 02 li 3, 2
# DIS-NEXT: 4: 06 00 00 00 38 63 00 0d paddi 3, 3, 13, 0
# DIS-NEXT: c: 06 00 00 00 38 63 00 0d paddi 3, 3, 13, 0
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-return55.ll
Expand Up @@ -21,7 +21,7 @@ entry:
; CHECK: blr
}

;CHECKOBJ: 00000000 <.foo>:
;CHECKOBJ: 00000000 <.text>:
;CHECKOBJ-NEXT: 0: 38 60 00 37 li 3, 55
;CHECKOBJ-NEXT: 4: 4e 80 00 20 blr{{[[:space:]] *}}
;CHECKOBJ-NEXT: 00000008 <.rodata.str1.1>:
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-user-defined-memcpy.ll
Expand Up @@ -102,7 +102,7 @@ declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture r
; 32-REL-NOT: Type: R_RBR (0x1A)

; 32-DIS: Disassembly of section .text:
; 32-DIS: 00000000 <.memcpy>:
; 32-DIS: 00000000 <.text>:
; 32-DIS-NEXT: 0: 38 60 00 03 li 3, 3
; 32-DIS-NEXT: 4: 4e 80 00 20 blr
; 32-DIS-NEXT: 8: 60 00 00 00 nop
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll
Expand Up @@ -62,7 +62,7 @@ entry:
;CHECK-NEXT: .space 1


;CHECKOBJ: 00000000 <.main>:
;CHECKOBJ: 00000000 <.text>:
;CHECKOBJ-NEXT: 0: 38 60 00 00 li 3, 0
;CHECKOBJ-NEXT: 4: 4e 80 00 20 blr
;CHECKOBJ-NEXT: ...{{[[:space:]] *}}
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-xcoff-reloc-symb.mir
Expand Up @@ -75,7 +75,7 @@ body: |

# DIS: Disassembly of section .text:
# DIS-EMPTY:
# DIS-NEXT: 00000000 <.foo>:
# DIS-NEXT: 00000000 <.text>:
# DIS-NEXT: 0: 80 62 00 00 lwz 3, 0(2)
# DIS-NEXT: 4: 4e 80 00 20 blr
# DIS-EMPTY:
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
Expand Up @@ -422,7 +422,7 @@ declare i32 @bar(i32)

; DIS: {{.*}}aix-xcoff-reloc.ll.tmp.o: file format aixcoff-rs6000
; DIS: Disassembly of section .text:
; DIS: 00000000 <.foo>:
; DIS: 00000000 <.text>:
; DIS-NEXT: 0: 7c 08 02 a6 mflr 0
; DIS-NEXT: 4: 90 01 00 08 stw 0, 8(1)
; DIS-NEXT: 8: 94 21 ff c0 stwu 1, -64(1)
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/PowerPC/aix-xcoff-textdisassembly.ll
Expand Up @@ -13,7 +13,7 @@ entry:
}

; CHECK: Disassembly of section .text:{{[[:space:]] *}}
; CHECK-NEXT: 00000000 <.foo>:
; CHECK-NEXT: 00000000 <.text>:
; CHECK-NEXT: 0: 38 60 00 00 li 3, 0
; CHECK-NEXT: 4: 4e 80 00 20 blr
; CHECK-NEXT: 8: 60 00 00 00 nop
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/tools/llvm-objdump/XCOFF/disassemble-all.test
Expand Up @@ -18,7 +18,7 @@

CHECK: Inputs/xcoff-section-headers.o: file format aixcoff-rs6000
CHECK: Disassembly of section .text:
CHECK: 00000000 <.func>:
CHECK: 00000000 <.text>:
CHECK-NEXT: 0: 80 62 00 04 lwz 3, 4(2)
WITH-R-NEXT: 00000002: R_TOC a
CHECK-NEXT: 4: 80 63 00 00 lwz 3, 0(3)
Expand Down
Expand Up @@ -22,7 +22,7 @@

COMMON: Inputs/xcoff-section-headers.o: file format aixcoff-rs6000
COMMON: Disassembly of section .text:
PLAIN: 00000000 <.func>:
PLAIN: 00000000 <.text>:
DESC: 00000000 (idx: 16) .func:
COMMON-NEXT: 0: 80 62 00 04 lwz 3, 4(2)
RELOC: 00000002: R_TOC (idx: 26) a[TC]
Expand Down
28 changes: 0 additions & 28 deletions llvm/test/tools/llvm-objdump/XCOFF/disassemble-symbol-priority.ll

This file was deleted.

Expand Up @@ -3,7 +3,8 @@
; RUN: | FileCheck %s

;; Expect to find the branch labels.
; CHECK-LABEL: <.internal>:
; CHECK-LABEL: <.text>:
;; TODO: <.internal> should be printed instead of <.text>.
; CHECK-NEXT: 0: mr 4, 3
; CHECK-NEXT: 4: li 3, 0
; CHECK-NEXT: 8: mtctr 4
Expand All @@ -18,11 +19,11 @@
; CHECK-NEXT: 60: bf 8, 0x84 <L1>
; CHECK-NEXT: <L0>:
; CHECK-NEXT: 64: mr 3, 31
; CHECK-NEXT: 68: bl 0x0 <.internal>
; CHECK-NEXT: 68: bl 0x0 <.text>
; CHECK-NEXT: 6c: mr 31, 3
; CHECK-NEXT: 70: cmplwi 3, 11
; CHECK-NEXT: 74: bt 0, 0x60 <L2>
; CHECK-NEXT: 78: bl 0x0 <.internal>
; CHECK-NEXT: 78: bl 0x0 <.text>
; CHECK-NEXT: 7c: nop
; CHECK-NEXT: 80: b 0x60 <L2>
; CHECK-NEXT: <L1>:
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/tools/llvm-objdump/XCOFF/print-linenumber.test
Expand Up @@ -17,7 +17,7 @@

# LINES32: Inputs/basic32.o: file format aixcoff-rs6000
# LINES32: Disassembly of section .text:
# LINES32: 00000000 <.main>:
# LINES32: 00000000 <.text>:
# LINES32: ; .main():
# LINES32-NEXT: ; /basic.c:1
# LINES32-NEXT: 0: 38 60 00 00 li 3, 0
Expand Down
3 changes: 0 additions & 3 deletions llvm/tools/llvm-objdump/llvm-objdump.cpp
Expand Up @@ -957,9 +957,6 @@ SymbolInfoTy objdump::createSymbolInfo(const ObjectFile *Obj,
getXCOFFSymbolCsectSMC(XCOFFObj, Symbol);
return SymbolInfoTy(Addr, Name, Smc, SymbolIndex,
isLabel(XCOFFObj, Symbol));
} else if (Obj->isXCOFF()) {
const SymbolRef::Type SymType = unwrapOrError(Symbol.getType(), FileName);
return SymbolInfoTy(Addr, Name, SymType, true);
} else
return SymbolInfoTy(Addr, Name,
Obj->isELF() ? getElfSymbolType(Obj, Symbol)
Expand Down

0 comments on commit 0bf3fec

Please sign in to comment.