Bind libObject API for obtaining the section containing a Symbol.
[oota-llvm.git] / lib / Object / Object.cpp
index 2ce98d7f9ca9c60b20bf24cd5e30094aef82b86e..638105b56b374effc3271bb76758e2c364a45968 100644 (file)
@@ -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();