[llvm] r277298 - [COFF] Expose iterators for ImportAddressTableRVA
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 31 12:40:02 PDT 2016
Author: majnemer
Date: Sun Jul 31 14:40:02 2016
New Revision: 277298
URL: http://llvm.org/viewvc/llvm-project?rev=277298&view=rev
Log:
[COFF] Expose iterators for ImportAddressTableRVA
Patch by Bandzi Michal!
Modified:
llvm/trunk/include/llvm/Object/COFF.h
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=277298&r1=277297&r2=277298&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Sun Jul 31 14:40:02 2016
@@ -899,6 +899,10 @@ public:
imported_symbol_iterator imported_symbol_end() const;
iterator_range<imported_symbol_iterator> imported_symbols() const;
+ imported_symbol_iterator lookup_table_begin() const;
+ imported_symbol_iterator lookup_table_end() const;
+ iterator_range<imported_symbol_iterator> lookup_table_symbols() const;
+
std::error_code getName(StringRef &Result) const;
std::error_code getImportLookupTableRVA(uint32_t &Result) const;
std::error_code getImportAddressTableRVA(uint32_t &Result) const;
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=277298&r1=277297&r2=277298&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Sun Jul 31 14:40:02 2016
@@ -1250,13 +1250,13 @@ importedSymbolEnd(uint32_t RVA, const CO
imported_symbol_iterator
ImportDirectoryEntryRef::imported_symbol_begin() const {
- return importedSymbolBegin(ImportTable[Index].ImportLookupTableRVA,
+ return importedSymbolBegin(ImportTable[Index].ImportAddressTableRVA,
OwningObject);
}
imported_symbol_iterator
ImportDirectoryEntryRef::imported_symbol_end() const {
- return importedSymbolEnd(ImportTable[Index].ImportLookupTableRVA,
+ return importedSymbolEnd(ImportTable[Index].ImportAddressTableRVA,
OwningObject);
}
@@ -1265,6 +1265,21 @@ ImportDirectoryEntryRef::imported_symbol
return make_range(imported_symbol_begin(), imported_symbol_end());
}
+imported_symbol_iterator ImportDirectoryEntryRef::lookup_table_begin() const {
+ return importedSymbolBegin(ImportTable[Index].ImportLookupTableRVA,
+ OwningObject);
+}
+
+imported_symbol_iterator ImportDirectoryEntryRef::lookup_table_end() const {
+ return importedSymbolEnd(ImportTable[Index].ImportLookupTableRVA,
+ OwningObject);
+}
+
+iterator_range<imported_symbol_iterator>
+ImportDirectoryEntryRef::lookup_table_symbols() const {
+ return make_range(lookup_table_begin(), lookup_table_end());
+}
+
std::error_code ImportDirectoryEntryRef::getName(StringRef &Result) const {
uintptr_t IntPtr = 0;
if (std::error_code EC =
More information about the llvm-commits
mailing list