From 0fbe7f6764a6e1add9cbd8d5cb90d9f9bb7b2836 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Wed, 27 Nov 2024 09:42:19 +0100 Subject: [PATCH] [Backport to 16] [NFC] Use hasAlignment helper (#2856) (#2880) Handle all queries of `Alignment` decorations through one and the same helper function. (cherry picked from commit 67685320c1192af7f8bb18c674064ac7f5888952) --- lib/SPIRV/SPIRVReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp index 8f6e6fa66..d7c42f6fb 100644 --- a/lib/SPIRV/SPIRVReader.cpp +++ b/lib/SPIRV/SPIRVReader.cpp @@ -3012,7 +3012,7 @@ void SPIRVToLLVM::transFunctionAttrs(SPIRVFunction *BF, Function *F) { if (BA->hasDecorate(DecorationMaxByteOffset, 0, &MaxOffset)) Builder.addDereferenceableAttr(MaxOffset); SPIRVWord AlignmentBytes = 0; - if (BA->hasDecorate(DecorationAlignment, 0, &AlignmentBytes)) + if (BA->hasAlignment(&AlignmentBytes)) Builder.addAlignmentAttr(AlignmentBytes); I->addAttrs(Builder); }