[PATCH] D49209: CodeGen: specify alignment for automatic variable initialization

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 12 16:51:34 PDT 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/CGBuilder.h:260
+                            CharUnits::fromQuantity(Offset.getSExtValue())));
+  }
+
----------------
Not sure about the new helper.  We already have CreateStructGEP and CreateConstArrayGEP which do approximately what you want.


================
Comment at: lib/CodeGen/CGDecl.cpp:901
       isa<llvm::ConstantExpr>(Init)) {
-    Builder.CreateDefaultAlignedStore(Init, Loc, isVolatile);
+    Builder.CreateAlignedStore(Init, Loc.getPointer(), Loc.getAlignment(),
+                               isVolatile);
----------------
`Builder.CreateStore(Init, Loc, isVolatile);`


Repository:
  rC Clang

https://reviews.llvm.org/D49209





More information about the cfe-commits mailing list