diff options
author | Ken Dyck <kd@kendyck.com> | 2011-01-19 01:58:38 +0000 |
---|---|---|
committer | Ken Dyck <kd@kendyck.com> | 2011-01-19 01:58:38 +0000 |
commit | fe71008c2764768f25478b16c1802755189ed7c9 (patch) | |
tree | 54b4b86c30e456a0ab8bf588a28d762dee47ea6f /lib/CodeGen/CGCall.cpp | |
parent | 69fc1b330090853ced40436805258fc9a0a70bdc (diff) |
Replace calls to getTypeSize() and getTypeAlign() with their 'InChars'
counterparts where char units are needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 01e9d8ea8c..e6e5ea1970 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -879,18 +879,19 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI, // FIXME: We should have a common utility for generating an aggregate // copy. const llvm::Type *I8PtrTy = Builder.getInt8PtrTy(); - unsigned Size = getContext().getTypeSize(Ty) / 8; + CharUnits Size = getContext().getTypeSizeInChars(Ty); Builder.CreateMemCpy(Builder.CreateBitCast(AlignedTemp, I8PtrTy), Builder.CreateBitCast(V, I8PtrTy), - llvm::ConstantInt::get(IntPtrTy, Size), + llvm::ConstantInt::get(IntPtrTy, + Size.getQuantity()), ArgI.getIndirectAlign(), false); V = AlignedTemp; } } else { // Load scalar value from indirect argument. - unsigned Alignment = getContext().getTypeAlignInChars(Ty).getQuantity(); - V = EmitLoadOfScalar(V, false, Alignment, Ty); + CharUnits Alignment = getContext().getTypeAlignInChars(Ty); + V = EmitLoadOfScalar(V, false, Alignment.getQuantity(), Ty); if (!getContext().typesAreCompatible(Ty, Arg->getType())) { // This must be a promotion, for something like // "void a(x) short x; {..." |