]> granicus.if.org Git - llvm/commitdiff
[llvm-objcopy] [COFF] Fix warnings abuilt missing field initialization. NFC.
authorMartin Storsjo <martin@martin.st>
Thu, 10 Jan 2019 21:59:41 +0000 (21:59 +0000)
committerMartin Storsjo <martin@martin.st>
Thu, 10 Jan 2019 21:59:41 +0000 (21:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350898 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-objcopy/COFF/Object.h
tools/llvm-objcopy/COFF/Reader.cpp

index ca1ff7f4c60f2c1063b395248cd6d4d185f061fd..7531fb4cf39e20466b8324818c0a27c4e935cfe9 100644 (file)
@@ -25,6 +25,9 @@ namespace objcopy {
 namespace coff {
 
 struct Relocation {
+  Relocation() {}
+  Relocation(const object::coff_relocation& R) : Reloc(R) {}
+
   object::coff_relocation Reloc;
   size_t Target;
   StringRef TargetName; // Used for diagnostics only
index 76b3f73debecc12792c6be71b60c3cc59a705cc6..2d3a5940aa39b9308afc05660771a6155d4d3291 100644 (file)
@@ -73,7 +73,7 @@ Error COFFReader::readSections(Object &Obj) const {
       return errorCodeToError(EC);
     ArrayRef<coff_relocation> Relocs = COFFObj.getRelocations(Sec);
     for (const coff_relocation &R : Relocs)
-      S.Relocs.push_back(Relocation{R});
+      S.Relocs.push_back(R);
     if (auto EC = COFFObj.getSectionName(Sec, S.Name))
       return errorCodeToError(EC);
     if (Sec->hasExtendedRelocations())