[DirectX] Properly fix for MaybeAlign API removal
authorChris Bieneman <chris.bieneman@me.com>
Wed, 29 Jun 2022 02:53:54 +0000 (21:53 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Wed, 29 Jun 2022 02:53:59 +0000 (21:53 -0500)
My last attempt caused a test case failure. This resovles the issue.

llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp

index 1aa1d5c..494a71e 100644 (file)
@@ -1251,7 +1251,7 @@ void DXILBitcodeWriter::writeModuleInfo() {
                                                            //| constant
     Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::VBR, 6));   // Initializer.
     Abbv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 5)); // Linkage.
-    if (MaxAlignment == Align(0))                          // Alignment.
+    if (!MaxAlignment)                                     // Alignment.
       Abbv->Add(BitCodeAbbrevOp(0));
     else {
       unsigned MaxEncAlignment = getEncodedAlign(MaxAlignment);