This is a follow-up discussed in D70495 thread.
The current logic is unusual for llvm-readobj. It doesn't print predecessors
list when it is empty. This is not good for machine parsers.
D70495 had to add this condition during refactoring to reduce amount of changes,
in tests, because the original code also had a similar logic.
Now seems it is time to get rid of it. This patch does it.
Differential revision: https://reviews.llvm.org/D70717
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 1425
# DSO-NEXT: Name: V1
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 1426
# DSO-NEXT: Name: V2
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: ]
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 98457184
# DSO-NEXT: Name: LIBSAMPLE_1.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 98456416
# DSO-NEXT: Name: LIBSAMPLE_2.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 4
# DSO-NEXT: Hash: 98456672
# DSO-NEXT: Name: LIBSAMPLE_3.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: ]
# DSO-NEXT: Index: 1
# DSO-NEXT: Hash: 127830196
# DSO-NEXT: Name: shared
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 2
# DSO-NEXT: Hash: 98457184
# DSO-NEXT: Name: LIBSAMPLE_1.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 3
# DSO-NEXT: Hash: 98456416
# DSO-NEXT: Name: LIBSAMPLE_2.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: Definition {
# DSO-NEXT: Version: 1
# DSO-NEXT: Index: 4
# DSO-NEXT: Hash: 98456672
# DSO-NEXT: Name: LIBSAMPLE_3.0
+# DSO-NEXT: Predecessors: []
# DSO-NEXT: }
# DSO-NEXT: ]
# DSO-NEXT: VersionRequirements [
# LLVM-NEXT: Index: 0
# LLVM-NEXT: Hash: 0
# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: Predecessors: []
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
# LLVM-NEXT: Index: 0
# LLVM-NEXT: Hash: 0
# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: Predecessors: []
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
# LLVM-NEXT: Index: 0
# LLVM-NEXT: Hash: 0
# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: Predecessors: []
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
# LLVM-NEXT: Index: 0
# LLVM-NEXT: Hash: 0
# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: Predecessors: []
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
# LLVM-NEXT: Index: 2
# LLVM-NEXT: Hash: 175630257
# LLVM-NEXT: Name: VERSION1
+# LLVM-NEXT: Predecessors: []
# LLVM-NEXT: }
# LLVM-NEXT: Definition {
# LLVM-NEXT: Version: 1
# PAST-STRTAB-END-LLVM-NEXT: Index: 0
# PAST-STRTAB-END-LLVM-NEXT: Hash: 0
# PAST-STRTAB-END-LLVM-NEXT: Name: <invalid vda_name: 5>
+# PAST-STRTAB-END-LLVM-NEXT: Predecessors: []
# PAST-STRTAB-END-LLVM-NEXT: }
# PAST-STRTAB-END-LLVM-NEXT: ]
# CHECK-NEXT: Index: 1
# CHECK-NEXT: Hash: 170240160
# CHECK-NEXT: Name: dso.so.0
+# CHECK-NEXT: Predecessors: []
# CHECK-NEXT: }
# CHECK-NEXT: Definition {
# CHECK-NEXT: Version: 1
# CHECK-NEXT: Index: 2
# CHECK-NEXT: Hash: 108387921
# CHECK-NEXT: Name: VERSION_1
+# CHECK-NEXT: Predecessors: []
# CHECK-NEXT: }
# CHECK-NEXT: Definition {
# CHECK-NEXT: Version: 1
W.printNumber("Index", D.Ndx);
W.printNumber("Hash", D.Hash);
W.printString("Name", D.Name.c_str());
-
- if (D.AuxV.empty())
- continue;
W.printList(
"Predecessors", D.AuxV,
[](raw_ostream &OS, const VerdAux &Aux) { OS << Aux.Name.c_str(); });