From: Ken Dyck Date: Fri, 22 Apr 2011 17:41:34 +0000 (+0000) Subject: Eliminate some literal 8s from EmitDeclare by converting to CharUnits. No X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0ebce0e15ad5cb0f3e346b35643c7f054a23c6b0;p=clang Eliminate some literal 8s from EmitDeclare by converting to CharUnits. No change in functionality intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129999 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 8a3cf6c515..aa664491fc 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1884,13 +1884,13 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, const llvm::Type *Int64Ty = llvm::Type::getInt64Ty(CGM.getLLVMContext()); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of __forwarding field - offset = - CharUnits::fromQuantity(CGM.getContext().Target.getPointerWidth(0)/8); + offset = CGM.getContext().toCharUnitsFromBits( + CGM.getContext().Target.getPointerWidth(0)); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of x field - offset = CharUnits::fromQuantity(XOffset/8); + offset = CGM.getContext().toCharUnitsFromBits(XOffset); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); // Create the descriptor for the variable. @@ -1991,12 +1991,12 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of __forwarding field - offset = CharUnits::fromQuantity(target.getPointerSize()/8); + offset = CGM.getContext().toCharUnitsFromBits(target.getPointerSize()); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpDeref)); addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIBuilder::OpPlus)); // offset of x field - offset = CharUnits::fromQuantity(XOffset/8); + offset = CGM.getContext().toCharUnitsFromBits(XOffset); addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity())); }