[PATCH] D104734: [llvm-diff] Explicitly check ConstantStructs for differences

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 12:26:18 PDT 2021


void added inline comments.


================
Comment at: llvm/tools/llvm-diff/DifferenceEngine.cpp:477
+      if (CSL->getType()->getNumElements() != CSR->getType()->getNumElements())
+        return false;
+
----------------
rjmccall wrote:
> Hmm.  I don't think it's okay to just compare the number of elements: if the types might be different, they might have different layouts.
The individual elements are checked in the loop below. I made it recursive because I couldn't count on the types to be uniqued, because of the naming differences.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104734



More information about the llvm-commits mailing list