Added accessors for getting coff_relocation info
authorMarshall Clow <mclow@qualcomm.com>
Mon, 18 Jun 2012 19:47:16 +0000 (19:47 +0000)
committerMarshall Clow <mclow@qualcomm.com>
Mon, 18 Jun 2012 19:47:16 +0000 (19:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158675 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Object/COFF.h
include/llvm/Object/ObjectFile.h
lib/Object/COFFObjectFile.cpp

index 29965a9de8ec198735e751b383827cc02f906b46..967420ec9f122fdc4dba52dd7cd42afab2680f39 100644 (file)
@@ -170,7 +170,8 @@ public:
 
   const coff_section *getCOFFSection(section_iterator &It) const;
   const coff_symbol *getCOFFSymbol(symbol_iterator &It) const;
-
+  const coff_relocation *getCOFFRelocation(relocation_iterator &It) const;
+  
   virtual uint8_t getBytesInAddress() const;
   virtual StringRef getFileFormatName() const;
   virtual unsigned getArch() const;
index 4dd7fb5813085fca42915cc4550b5417577d3d8f..76b493eba326fd3a0d42f3904bcc2a05222220f3 100644 (file)
@@ -126,6 +126,8 @@ public:
   ///
   /// This is for display purposes only.
   error_code getValueString(SmallVectorImpl<char> &Result) const;
+
+  DataRefImpl getRawDataRefImpl() const;
 };
 typedef content_iterator<RelocationRef> relocation_iterator;
 
@@ -570,6 +572,11 @@ inline error_code RelocationRef::getValueString(SmallVectorImpl<char> &Result)
 inline error_code RelocationRef::getHidden(bool &Result) const {
   return OwningObject->getRelocationHidden(RelocationPimpl, Result);
 }
+
+inline DataRefImpl RelocationRef::getRawDataRefImpl() const {
+  return RelocationPimpl;
+}
+
 // Inline function definitions.
 inline LibraryRef::LibraryRef(DataRefImpl LibraryP, const ObjectFile *Owner)
   : LibraryPimpl(LibraryP)
index a8f8d604db8aa472659027d86012e0a68c1f0e11..8ab54c62950422b4abafe4942835c68702ce17df 100644 (file)
@@ -724,6 +724,11 @@ const coff_symbol *COFFObjectFile::getCOFFSymbol(symbol_iterator &It) const {
   return toSymb(It->getRawDataRefImpl());
 }
 
+const coff_relocation *COFFObjectFile::getCOFFRelocation(
+                                             relocation_iterator &It) const {
+  return toRel(It->getRawDataRefImpl());
+}
+
 
 #define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(enum) \
   case COFF::enum: res = #enum; break;