diff options
author | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
---|---|---|
committer | Ken Dyck <ken.dyck@onsemi.com> | 2010-01-11 17:06:35 +0000 |
commit | 199c3d6cd16aebbb9c7f0d42af9d922c9628bf70 (patch) | |
tree | 6cd559c088b3da1861835639e05db09d5bb16f08 /lib/CodeGen/CGDebugInfo.cpp | |
parent | e27d87ff27b26e5886cf6472271d3b5e18ec3d87 (diff) |
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93153 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 19695c8781..89f3820d39 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1379,7 +1379,7 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag, else Unit = llvm::DICompileUnit(); - uint64_t offset = CGF->BlockDecls[Decl]; + CharUnits offset = CGF->BlockDecls[Decl]; llvm::SmallVector<llvm::Value *, 9> addr; llvm::LLVMContext &VMContext = CGM.getLLVMContext(); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), @@ -1387,22 +1387,24 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag, addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), llvm::DIFactory::OpPlus)); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), - offset)); + offset.getQuantity())); if (BDRE->isByRef()) { addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), llvm::DIFactory::OpDeref)); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), llvm::DIFactory::OpPlus)); - offset = CGF->LLVMPointerWidth/8; // offset of __forwarding field + // offset of __forwarding field + offset = CharUnits::fromQuantity(CGF->LLVMPointerWidth/8); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), - offset)); + offset.getQuantity())); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), llvm::DIFactory::OpDeref)); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), llvm::DIFactory::OpPlus)); - offset = XOffset/8; // offset of x field + // offset of x field + offset = CharUnits::fromQuantity(XOffset/8); addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext), - offset)); + offset.getQuantity())); } // Create the descriptor for the variable. |