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

Eric Christopher echristo at gmail.com
Mon Feb 10 14:26:43 PST 2014


Might want to increase the debug version number because of this.
Previously working code will start asserting/crashing (see PR18790).

-eric

On Mon, Feb 3, 2014 at 3:08 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 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));
>  }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list