[PATCH] D126257: Round up zero-sized symbols to 1 byte in `.debug_aranges`.

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 09:26:36 PDT 2022


bjope added inline comments.


================
Comment at: llvm/test/CodeGen/Generic/dwarf-aranges-zero-size.ll:18
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "EXAMPLE", linkageName: "EXAMPLE", scope: null, file: null, line: 161, type: !2, isLocal: false, isDefinition: true, align: 1)
+!2 = !DIBasicType(name: "()", encoding: DW_ATE_unsigned)
----------------
Notice that align here is specified in bits. I think it is a bit weird to have a 1 bit alignment?

So why do I care? Our downstream fork is checking that alignment is a multiple of byte size since the getAlignInBytes methods in DebugInfoMetadata.h is dividing the alignment specified in bits by the byte size. This test case hit such assertions.

Do you think it is ok to change this to "align: 8"?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126257



More information about the llvm-commits mailing list