[llvm] r181748 - Assert that DIEEntries are constructed with non-null DIEs
David Blaikie
dblaikie at gmail.com
Mon May 13 17:35:20 PDT 2013
Author: dblaikie
Date: Mon May 13 19:35:19 2013
New Revision: 181748
URL: http://llvm.org/viewvc/llvm-project?rev=181748&view=rev
Log:
Assert that DIEEntries are constructed with non-null DIEs
This just brings a crash a little further forward from DWARF emission to
DIE construction to make errors easier to diagnose.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h?rev=181748&r1=181747&r2=181748&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIE.h Mon May 13 19:35:19 2013
@@ -325,7 +325,9 @@ namespace llvm {
class DIEEntry : public DIEValue {
DIE *const Entry;
public:
- explicit DIEEntry(DIE *E) : DIEValue(isEntry), Entry(E) {}
+ explicit DIEEntry(DIE *E) : DIEValue(isEntry), Entry(E) {
+ assert(E && "Cannot construct a DIEEntry with a null DIE");
+ }
DIE *getEntry() const { return Entry; }
More information about the llvm-commits
mailing list