[llvm] r200721 - DIBuilder: simplify array generation to produce true zero-length arrays

David Blaikie dblaikie at gmail.com
Mon Feb 3 15:08:55 PST 2014


Author: dblaikie
Date: Mon Feb  3 17:08:54 2014
New Revision: 200721

URL: http://llvm.org/viewvc/llvm-project?rev=200721&view=rev
Log:
DIBuilder: simplify array generation to produce true zero-length arrays

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.

Modified:
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=200721&r1=200720&r2=200721&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Mon Feb  3 17:08:54 2014
@@ -902,10 +902,6 @@ DIBuilder::createForwardDecl(unsigned Ta
 
 /// 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));
 }
 





More information about the llvm-commits mailing list