diff options
author | Owen Anderson <resistor@mac.com> | 2011-10-27 17:15:47 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2011-10-27 17:15:47 +0000 |
commit | e245af65fa28cb88cb533f49d3755d034b252e88 (patch) | |
tree | 68b2f3a69d8a10727f33b51df676dfb97e682e7b /llvm/include/llvm-c | |
parent | 2aed4393b86314f31488609d803a5525d1e0cf88 (diff) | |
download | bcm5719-llvm-e245af65fa28cb88cb533f49d3755d034b252e88.tar.gz bcm5719-llvm-e245af65fa28cb88cb533f49d3755d034b252e88.zip |
Add relocation iterators to the libObject C API.
llvm-svn: 143107
Diffstat (limited to 'llvm/include/llvm-c')
-rw-r--r-- | llvm/include/llvm-c/Object.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/include/llvm-c/Object.h b/llvm/include/llvm-c/Object.h index 91dc274267c..ccf62868cf2 100644 --- a/llvm/include/llvm-c/Object.h +++ b/llvm/include/llvm-c/Object.h @@ -32,6 +32,7 @@ extern "C" { typedef struct LLVMOpaqueObjectFile *LLVMObjectFileRef; typedef struct LLVMOpaqueSectionIterator *LLVMSectionIteratorRef; typedef struct LLVMOpaqueSymbolIterator *LLVMSymbolIteratorRef; +typedef struct LLVMOpaqueRelocationIterator *LLVMRelocationIteratorRef; // ObjectFile creation LLVMObjectFileRef LLVMCreateObjectFile(LLVMMemoryBufferRef MemBuf); @@ -61,6 +62,14 @@ uint64_t LLVMGetSectionAddress(LLVMSectionIteratorRef SI); LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI, LLVMSymbolIteratorRef Sym); +// Section Relocation iterators +LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section); +void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef RI); +LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section, + LLVMRelocationIteratorRef RI); +void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef RI); + + // SymbolRef accessors const char *LLVMGetSymbolName(LLVMSymbolIteratorRef SI); uint64_t LLVMGetSymbolAddress(LLVMSymbolIteratorRef SI); @@ -99,6 +108,17 @@ namespace llvm { return reinterpret_cast<LLVMSymbolIteratorRef> (const_cast<symbol_iterator*>(SI)); } + + inline relocation_iterator *unwrap(LLVMRelocationIteratorRef SI) { + return reinterpret_cast<relocation_iterator*>(SI); + } + + inline LLVMRelocationIteratorRef + wrap(const relocation_iterator *SI) { + return reinterpret_cast<LLVMRelocationIteratorRef> + (const_cast<relocation_iterator*>(SI)); + } + } } |