[lld] r259441 - Add pointerKind() method to the MachO ArchHandler's. NFC.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 1 16:02:50 PST 2016
Author: pete
Date: Mon Feb 1 18:02:50 2016
New Revision: 259441
URL: http://llvm.org/viewvc/llvm-project?rev=259441&view=rev
Log:
Add pointerKind() method to the MachO ArchHandler's. NFC.
The ObjCPass is going to need to create pointer sized relocations in
the ObjC sections. This method will be used to give us a target independent
way of getting the correct kind for the refererence.
Modified:
lld/trunk/lib/ReaderWriter/MachO/ArchHandler.h
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp
lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler.h?rev=259441&r1=259440&r2=259441&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler.h (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler.h Mon Feb 1 18:02:50 2016
@@ -92,6 +92,10 @@ public:
/// __eh_frame.
virtual Reference::KindValue unwindRefToEhFrameKind() = 0;
+ /// Returns a pointer sized reference kind. On 64-bit targets this will
+ /// likely be something like pointer64, and pointer32 on 32-bit targets.
+ virtual Reference::KindValue pointerKind() = 0;
+
virtual const Atom *fdeTargetFunction(const DefinedAtom *fde);
/// Used by normalizedFromAtoms() to know where to generated rebasing and
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp?rev=259441&r1=259440&r2=259441&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm.cpp Mon Feb 1 18:02:50 2016
@@ -63,6 +63,10 @@ public:
return invalid;
}
+ Reference::KindValue pointerKind() override {
+ return invalid;
+ }
+
uint32_t dwarfCompactUnwindType() override {
// FIXME
return -1;
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp?rev=259441&r1=259440&r2=259441&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp Mon Feb 1 18:02:50 2016
@@ -120,6 +120,10 @@ public:
return unwindInfoToEhFrame;
}
+ Reference::KindValue pointerKind() override {
+ return pointer64;
+ }
+
uint32_t dwarfCompactUnwindType() override {
return 0x03000000;
}
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp?rev=259441&r1=259440&r2=259441&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86.cpp Mon Feb 1 18:02:50 2016
@@ -70,6 +70,10 @@ public:
return invalid;
}
+ Reference::KindValue pointerKind() override {
+ return invalid;
+ }
+
uint32_t dwarfCompactUnwindType() override {
return 0x04000000U;
}
Modified: lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp?rev=259441&r1=259440&r2=259441&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/ArchHandler_x86_64.cpp Mon Feb 1 18:02:50 2016
@@ -116,6 +116,10 @@ public:
return unwindInfoToEhFrame;
}
+ Reference::KindValue pointerKind() override {
+ return pointer64;
+ }
+
uint32_t dwarfCompactUnwindType() override {
return 0x04000000U;
}
More information about the llvm-commits
mailing list