================
@@ -284,7 +286,8 @@ MDTuple *ResourceInfo::getAsMetadata(LLVMContext &Ctx) 
const {
 
 std::pair<uint32_t, uint32_t> ResourceInfo::getAnnotateProps() const {
   uint32_t ResourceKind = llvm::to_underlying(Kind);
-  uint32_t AlignLog2 = isStruct() ? Log2(Struct.Alignment) : 0;
+  uint32_t AlignLog2 =
+      isStruct() && Struct.Alignment ? Log2(*Struct.Alignment) : 0;
----------------
python3kgae wrote:

Could we change it to 
```
(isStruct() && Struct.Alignment) ? Log2(*Struct.Alignment) : 0;
```
 so it is easier to read?


https://github.com/llvm/llvm-project/pull/100697
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to