[PATCH] D24426: DebugInfo: Pass non-zero alignment to DIBuilder only if aligment was forced

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 3 11:58:46 PDT 2016


rnk accepted this revision.
rnk added a reviewer: rnk.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm



> CGDebugInfo.cpp:54-56
> +  auto TI = Ctx.getTypeInfo(Ty);
> +  return TI.AlignIsRequired ? Ctx.toCharUnitsFromBits(TI.Align).getQuantity()
> +                            : 0;

Don't duplicate, just delegate to the Type * overload:

  return getTypeAlignIfRequired(Ty.getTypePtr(), Ctx);

https://reviews.llvm.org/D24426





More information about the cfe-commits mailing list