[Lldb-commits] [PATCH] D56229: [PECOFF] Implementation of ObjectFilePECOFF:: GetUUID()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Apr 28 23:57:18 PDT 2019


labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.


================
Comment at: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:81
+        info.Age = read32be(&pdb_info->PDB70.Age);
+        return UUID::fromOptionalData((uint8_t *)&info, sizeof(info));
+      }
----------------
this cast is unneeded as the function takes a `void*`


================
Comment at: source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp:176-177
+  auto COFFObj =
+      llvm::dyn_cast<llvm::object::COFFObjectFile>(binary->getBinary());
+  assert(COFFObj);
+
----------------
If you change the `dyn_cast` into a plain `cast` then you can drop the assert (as it will do the asserting for you).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56229/new/

https://reviews.llvm.org/D56229





More information about the lldb-commits mailing list