aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-25 03:29:35 +0000
committerChris Lattner <sabre@nondot.org>2010-01-25 03:29:35 +0000
commit14b1a363fbc42f3bac7e6a08a5a7bc425d3537bf (patch)
tree2d4e813dc9a690cd772f95b9c6c97995c952058d /lib/CodeGen/CGDebugInfo.cpp
parent90859ae3b6acbdc48113cddb95984e3472a51772 (diff)
simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94401 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index cd81d99775..a5d990a4ed 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1498,30 +1498,21 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
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),
- llvm::DIFactory::OpDeref));
- addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext),
- llvm::DIFactory::OpPlus));
- addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext),
- offset.getQuantity()));
+ const llvm::Type *Int64Ty = llvm::Type::getInt64Ty(CGM.getLLVMContext());
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpDeref));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpPlus));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, 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));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpDeref));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpPlus));
// offset of __forwarding field
offset = CharUnits::fromQuantity(CGF->LLVMPointerWidth/8);
- addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext),
- 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));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity()));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpDeref));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, llvm::DIFactory::OpPlus));
// offset of x field
offset = CharUnits::fromQuantity(XOffset/8);
- addr.push_back(llvm::ConstantInt::get(llvm::Type::getInt64Ty(VMContext),
- offset.getQuantity()));
+ addr.push_back(llvm::ConstantInt::get(Int64Ty, offset.getQuantity()));
}
// Create the descriptor for the variable.