mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-06 02:17:20 +00:00
Convert getFileOffset to getOffset and move it to its only user.
We normally don't drop functions from the C API's, but in this case I think we can: * The old implementation of getFileOffset was fairly broken * The introduction of LLVMGetSymbolFileOffset was itself a C api breaking change as it removed LLVMGetSymbolOffset. * It is an incredibly specialized use case. The only reason MCJIT needs it is because of its odd position of being a dynamic linker of .o files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206750 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -310,14 +310,6 @@ class Symbol(LLVMObject):
|
||||
|
||||
return lib.LLVMGetSymbolAddress(self)
|
||||
|
||||
@CachedProperty
|
||||
def file_offset(self):
|
||||
"""The offset of this symbol in the file, in long bytes."""
|
||||
if self.expired:
|
||||
raise Exception('Symbol instance has expired.')
|
||||
|
||||
return lib.LLVMGetSymbolFileOffset(self)
|
||||
|
||||
@CachedProperty
|
||||
def size(self):
|
||||
"""The size of the symbol, in long bytes."""
|
||||
@@ -345,7 +337,6 @@ class Symbol(LLVMObject):
|
||||
"""Cache all cacheable properties."""
|
||||
getattr(self, 'name')
|
||||
getattr(self, 'address')
|
||||
getattr(self, 'file_offset')
|
||||
getattr(self, 'size')
|
||||
|
||||
def expire(self):
|
||||
@@ -495,9 +486,6 @@ def register_library(library):
|
||||
library.LLVMGetSymbolAddress.argtypes = [Symbol]
|
||||
library.LLVMGetSymbolAddress.restype = c_uint64
|
||||
|
||||
library.LLVMGetSymbolFileOffset.argtypes = [Symbol]
|
||||
library.LLVMGetSymbolFileOffset.restype = c_uint64
|
||||
|
||||
library.LLVMGetSymbolSize.argtypes = [Symbol]
|
||||
library.LLVMGetSymbolSize.restype = c_uint64
|
||||
|
||||
|
Reference in New Issue
Block a user