summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-09-21 16:41:29 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-09-21 16:41:29 +0000
commit4b57204e80aaa206d126277456cfc6186b8e1503 (patch)
tree48521210c57254f6758e3723f752201da6137b84 /llvm/lib
parent1ffcf527c7566b623c79b687c10eb78c926502d7 (diff)
downloadbcm5719-llvm-4b57204e80aaa206d126277456cfc6186b8e1503.tar.gz
bcm5719-llvm-4b57204e80aaa206d126277456cfc6186b8e1503.zip
Simplify code.
llvm-svn: 114444
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 53189b8fdfe..fec269e2205 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -701,15 +701,13 @@ Constant *DIFactory::GetTagConstant(unsigned TAG) {
/// GetOrCreateArray - Create an descriptor for an array of descriptors.
/// This implicitly uniques the arrays created.
DIArray DIFactory::GetOrCreateArray(DIDescriptor *Tys, unsigned NumTys) {
- SmallVector<Value*, 16> Elts;
-
- if (NumTys == 0)
- Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
- else
- for (unsigned i = 0; i != NumTys; ++i)
- Elts.push_back(Tys[i]);
+ if (NumTys == 0) {
+ Value *Null = llvm::Constant::getNullValue(Type::getInt32Ty(VMContext));
+ return DIArray(MDNode::get(VMContext, &Null, 1));
+ }
- return DIArray(MDNode::get(VMContext,Elts.data(), Elts.size()));
+ SmallVector<Value *, 16> Elts(Tys, Tys+NumTys);
+ return DIArray(MDNode::get(VMContext, Elts.data(), Elts.size()));
}
/// GetOrCreateSubrange - Create a descriptor for a value range. This
OpenPOWER on IntegriCloud