[PATCH] D159339: [urgent][CodeGen] First check the kind and then the llvm::Function properties.

Vassil Vassilev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 1 12:53:22 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG92246a9be0ba: [CodeGen] First check the kind and then the llvm::Function properties. (authored by v.g.vassilev).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159339

Files:
  clang/lib/CodeGen/CodeGenModule.cpp


Index: clang/lib/CodeGen/CodeGenModule.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenModule.cpp
+++ clang/lib/CodeGen/CodeGenModule.cpp
@@ -2401,7 +2401,7 @@
   // functions. If the current target's C++ ABI requires this and this is a
   // member function, set its alignment accordingly.
   if (getTarget().getCXXABI().areMemberFunctionsAligned()) {
-    if (F->getPointerAlignment(getDataLayout()) < 2 && isa<CXXMethodDecl>(D))
+    if (isa<CXXMethodDecl>(D) && F->getPointerAlignment(getDataLayout()) < 2)
       F->setAlignment(std::max(llvm::Align(2), F->getAlign().valueOrOne()));
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159339.555476.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230901/6d9b68a8/attachment.bin>


More information about the cfe-commits mailing list