Consolidate some of the lit tests.
[oota-llvm.git] / tools / llvm-objdump / COFFDump.cpp
index ed4d1c3344fdb6d3f465f8de495186f8e349379c..bca6fc983d89ea6983ea1f360e417eb76eae75b1 100644 (file)
@@ -20,9 +20,9 @@
 #include "llvm/Object/ObjectFile.h"
 #include "llvm/Support/Format.h"
 #include "llvm/Support/SourceMgr.h"
+#include "llvm/Support/Win64EH.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/system_error.h"
-#include "llvm/Support/Win64EH.h"
 #include <algorithm>
 #include <cstring>
 
@@ -178,7 +178,7 @@ static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
     uint64_t Ofs;
     if (error_code ec = I->getOffset(Ofs)) return ec;
     if (Ofs == Offset) {
-      if (error_code ec = I->getSymbol(Sym)) return ec;
+      Sym = *I->getSymbol();
       break;
     }
   }
@@ -229,7 +229,7 @@ static void printCOFFSymbolAddress(llvm::raw_ostream &Out,
 
 void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
   const coff_file_header *Header;
-  if (error(Obj->getHeader(Header))) return;
+  if (error(Obj->getCOFFHeader(Header))) return;
 
   if (Header->Machine != COFF::IMAGE_FILE_MACHINE_AMD64) {
     errs() << "Unsupported image machine type "
@@ -277,26 +277,26 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
 
       outs() << "  Start Address: ";
       printCOFFSymbolAddress(outs(), Rels, SectionOffset +
-                             offsetof(RuntimeFunction, StartAddress),
+                             /*offsetof(RuntimeFunction, StartAddress)*/ 0,
                              I->StartAddress);
       outs() << "\n";
 
       outs() << "  End Address: ";
       printCOFFSymbolAddress(outs(), Rels, SectionOffset +
-                             offsetof(RuntimeFunction, EndAddress),
+                             /*offsetof(RuntimeFunction, EndAddress)*/ 4,
                              I->EndAddress);
       outs() << "\n";
 
       outs() << "  Unwind Info Address: ";
       printCOFFSymbolAddress(outs(), Rels, SectionOffset +
-                             offsetof(RuntimeFunction, UnwindInfoOffset),
+                             /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
                              I->UnwindInfoOffset);
       outs() << "\n";
 
       ArrayRef<uint8_t> XContents;
       uint64_t UnwindInfoOffset = 0;
       if (error(getSectionContents(Obj, Rels, SectionOffset +
-                                   offsetof(RuntimeFunction, UnwindInfoOffset),
+                              /*offsetof(RuntimeFunction, UnwindInfoOffset)*/ 8,
                                    XContents, UnwindInfoOffset))) continue;
       if (XContents.empty()) continue;