[PATCH] D143760: [Codeview] Fix incorrect size determination for complex types.

Steve Merritt via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 12:27:37 PST 2023


smerritt added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1796-1797
   case dwarf::DW_ATE_complex_float:
+    // The CodeView size for a complex represents the size of
+    // an individual component.
     switch (ByteSize) {
----------------
dblaikie wrote:
> When you say "The CodeView size" what do you mean? The size that some frontend is encoding in the size in the LLVM IR debug info metadata? Is it possible that the bug is in the frontend, rather than here?
> 
> (& looking at the boolean case above, I guess these `SimpleTypeKind::*N` are N in bits? Is that tru efor Boolean and Complex?)
> 
> I guess a broad question: Where's the data coming from that informs what's correct and motivates this patch/change?
By "The CodeView size" I mean the size that appears as part of the name of the SimpleTypeKind enum, and yes these numbers represent bit size for both Boolean and Complex.  These enums are defined in TypeIndex.h and relate back to the enums defined in the cvinfo.h file uploaded to github by MS under microsoft-pdb.

No, I don't think there is a front end bug here.  It's just the Codeview entry for complex can seem a bit different than the other numeric leaves.

As for where the data comes from, under the microsoft-pdb github you can also find a link to a document called Microsoft Symbol and Type Information.  In that document, under the section "Numeric Leaves", you can find the definition for the Complex entries.


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

https://reviews.llvm.org/D143760



More information about the llvm-commits mailing list