DIBuilder: simplify array generation to produce true zero-length arrays
authorDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Feb 2014 23:08:54 +0000 (23:08 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Mon, 3 Feb 2014 23:08:54 +0000 (23:08 +0000)
For some anachronistic reason we were producing {i32 0} for zero-length
debug info arrays.

(this change is paired with a Clang change and may cause temporary
buildbot noise)

Let's not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200721 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DIBuilder.cpp

index c7e75849005f716f03ef0a557869d28b3eaf5695..fc80ba9e64a9a5d868abac280891a966bbd9936b 100644 (file)
@@ -902,10 +902,6 @@ DIBuilder::createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
 
 /// getOrCreateArray - Get a DIArray, create one if required.
 DIArray DIBuilder::getOrCreateArray(ArrayRef<Value *> Elements) {
-  if (Elements.empty()) {
-    Value *Null = Constant::getNullValue(Type::getInt32Ty(VMContext));
-    return DIArray(MDNode::get(VMContext, Null));
-  }
   return DIArray(MDNode::get(VMContext, Elements));
 }