aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm-c/Object.h2
-rw-r--r--lib/Object/Object.cpp6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm-c/Object.h b/include/llvm-c/Object.h
index 3e6e1e3ffc..6acad85c55 100644
--- a/include/llvm-c/Object.h
+++ b/include/llvm-c/Object.h
@@ -43,6 +43,8 @@ void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI);
LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
LLVMSectionIteratorRef SI);
void LLVMMoveToNextSection(LLVMSectionIteratorRef SI);
+void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
+ LLVMSymbolIteratorRef Sym);
// ObjectFile Symbol iterators
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile);
diff --git a/lib/Object/Object.cpp b/lib/Object/Object.cpp
index 2ce98d7f9c..638105b56b 100644
--- a/lib/Object/Object.cpp
+++ b/lib/Object/Object.cpp
@@ -48,6 +48,12 @@ void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {
if (ec) report_fatal_error("LLVMMoveToNextSection failed: " + ec.message());
}
+void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
+ LLVMSymbolIteratorRef Sym) {
+ if (error_code ec = (*unwrap(Sym))->getSection(*unwrap(Sect)))
+ report_fatal_error(ec.message());
+}
+
// ObjectFile Symbol iterators
LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile) {
symbol_iterator SI = unwrap(ObjectFile)->begin_symbols();