[PATCH] D68141: [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

Clement Courbet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 27 08:20:05 PDT 2019


courbet added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64StackTagging.cpp:461
 void AArch64StackTagging::alignAndPadAlloca(AllocaInfo &Info) {
-  unsigned NewAlignment = std::max(Info.AI->getAlignment(), kTagGranuleSize);
+  MaybeAlign NewAlignment(std::max(Info.AI->getAlignment(), kTagGranuleSize));
   Info.AI->setAlignment(NewAlignment);
----------------
This could be an align, with a static_assert that  `kTagGranuleSize` is > 0


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:2909
               ".byval");
-      AI->setAlignment(Align);
+      AI->setAlignment(MaybeAlign(Align));
       Arg.replaceAllUsesWith(AI);
----------------
This is an `Align` because the `0` case has been checked just above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68141





More information about the cfe-commits mailing list