[lld] r259450 - Set ordinals of all File's created in MachO passes.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 1 17:52:40 PST 2016
Author: pete
Date: Mon Feb 1 19:52:40 2016
New Revision: 259450
URL: http://llvm.org/viewvc/llvm-project?rev=259450&view=rev
Log:
Set ordinals of all File's created in MachO passes.
When we do debug printing of atoms, they expect their parent file
to have an ordinal. Right now we trigger a bunch of asserts.
This doesn't actually manifest in differences in any real tests, but
even if the only thing it does is improve debuggability then its still
useful.
Modified:
lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp
lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp
lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
lld/trunk/lib/ReaderWriter/MachO/TLVPass.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp?rev=259450&r1=259449&r2=259450&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/CompactUnwindPass.cpp Mon Feb 1 19:52:40 2016
@@ -274,7 +274,9 @@ public:
CompactUnwindPass(const MachOLinkingContext &context)
: _ctx(context), _archHandler(_ctx.archHandler()),
_file("<mach-o Compact Unwind Pass>"),
- _isBig(MachOLinkingContext::isBigEndian(_ctx.arch())) {}
+ _isBig(MachOLinkingContext::isBigEndian(_ctx.arch())) {
+ _file.setOrdinal(_ctx.getNextOrdinalAndIncrement());
+ }
private:
std::error_code perform(SimpleFile &mergedFile) override {
Modified: lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp?rev=259450&r1=259449&r2=259450&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/GOTPass.cpp Mon Feb 1 19:52:40 2016
@@ -91,7 +91,9 @@ class GOTPass : public Pass {
public:
GOTPass(const MachOLinkingContext &context)
: _ctx(context), _archHandler(_ctx.archHandler()),
- _file("<mach-o GOT Pass>") {}
+ _file("<mach-o GOT Pass>") {
+ _file.setOrdinal(_ctx.getNextOrdinalAndIncrement());
+ }
private:
std::error_code perform(SimpleFile &mergedFile) override {
Modified: lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp?rev=259450&r1=259449&r2=259450&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ShimPass.cpp Mon Feb 1 19:52:40 2016
@@ -42,7 +42,9 @@ class ShimPass : public Pass {
public:
ShimPass(const MachOLinkingContext &context)
: _ctx(context), _archHandler(_ctx.archHandler()),
- _stubInfo(_archHandler.stubInfo()), _file("<mach-o shim pass>") {}
+ _stubInfo(_archHandler.stubInfo()), _file("<mach-o shim pass>") {
+ _file.setOrdinal(_ctx.getNextOrdinalAndIncrement());
+ }
std::error_code perform(SimpleFile &mergedFile) override {
// Scan all references in all atoms.
Modified: lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp?rev=259450&r1=259449&r2=259450&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp Mon Feb 1 19:52:40 2016
@@ -199,7 +199,9 @@ class StubsPass : public Pass {
public:
StubsPass(const MachOLinkingContext &context)
: _ctx(context), _archHandler(_ctx.archHandler()),
- _stubInfo(_archHandler.stubInfo()), _file("<mach-o Stubs pass>") {}
+ _stubInfo(_archHandler.stubInfo()), _file("<mach-o Stubs pass>") {
+ _file.setOrdinal(_ctx.getNextOrdinalAndIncrement());
+ }
std::error_code perform(SimpleFile &mergedFile) override {
// Skip this pass if output format uses text relocations instead of stubs.
Modified: lld/trunk/lib/ReaderWriter/MachO/TLVPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/TLVPass.cpp?rev=259450&r1=259449&r2=259450&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/TLVPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/TLVPass.cpp Mon Feb 1 19:52:40 2016
@@ -65,7 +65,9 @@ class TLVPass : public Pass {
public:
TLVPass(const MachOLinkingContext &context)
: _ctx(context), _archHandler(_ctx.archHandler()),
- _file("<mach-o TLV Pass>") {}
+ _file("<mach-o TLV Pass>") {
+ _file.setOrdinal(_ctx.getNextOrdinalAndIncrement());
+ }
private:
std::error_code perform(SimpleFile &mergedFile) override {
More information about the llvm-commits
mailing list