mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
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. llvm-svn: 259450
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user