summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-10-27 17:15:47 +0000
committerOwen Anderson <resistor@mac.com>2011-10-27 17:15:47 +0000
commitd8b0b915c5a94806596c381660c548aabef447b2 (patch)
tree971799b33c52c21c0ef904f27c2422f60e3e3907 /include
parentbc1430a0a0b3f97b86039950e57d832cb01f1cf6 (diff)
downloadllvm-d8b0b915c5a94806596c381660c548aabef447b2.tar.gz
llvm-d8b0b915c5a94806596c381660c548aabef447b2.tar.bz2
llvm-d8b0b915c5a94806596c381660c548aabef447b2.tar.xz
Add relocation iterators to the libObject C API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143107 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm-c/Object.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/llvm-c/Object.h b/include/llvm-c/Object.h
index 91dc274267..ccf62868cf 100644
--- a/include/llvm-c/Object.h
+++ b/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));
+ }
+
}
}