diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-02-11 23:57:03 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-02-11 23:57:03 +0000 |
commit | 5201930762a1505c53bc16c015a176c4cc3f2dd1 (patch) | |
tree | 7d0ee01e4bebc683872b5e4982a30b91b5a5d0ee /llvm/lib | |
parent | 57add3e4eedb9ce9247a889b3fc8b1664126e870 (diff) | |
download | bcm5719-llvm-5201930762a1505c53bc16c015a176c4cc3f2dd1.tar.gz bcm5719-llvm-5201930762a1505c53bc16c015a176c4cc3f2dd1.zip |
DwarfUnit: Replace unnecessary conditionals with asserts.
We used to be pretty vague about what debug entities were what, with
many conditionals to silently drop/skip/accept things. These don't seem
to be relevant anymore.
llvm-svn: 201194
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 6c9e40b0668..89bb7fbf815 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -356,9 +356,7 @@ void DwarfUnit::addBlock(DIE *Die, dwarf::Attribute Attribute, /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DIVariable V) { - // Verify variable. - if (!V.isVariable()) - return; + assert(V.isVariable()); unsigned Line = V.getLineNumber(); if (Line == 0) @@ -374,9 +372,7 @@ void DwarfUnit::addSourceLine(DIE *Die, DIVariable V) { /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DIGlobalVariable G) { - // Verify global variable. - if (!G.isGlobalVariable()) - return; + assert(G.isGlobalVariable()); unsigned Line = G.getLineNumber(); if (Line == 0) @@ -391,9 +387,7 @@ void DwarfUnit::addSourceLine(DIE *Die, DIGlobalVariable G) { /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DISubprogram SP) { - // Verify subprogram. - if (!SP.isSubprogram()) - return; + assert(SP.isSubprogram()); // If the line number is 0, don't add it. unsigned Line = SP.getLineNumber(); @@ -410,9 +404,7 @@ void DwarfUnit::addSourceLine(DIE *Die, DISubprogram SP) { /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DIType Ty) { - // Verify type. - if (!Ty.isType()) - return; + assert(Ty.isType()); unsigned Line = Ty.getLineNumber(); if (Line == 0) @@ -427,9 +419,7 @@ void DwarfUnit::addSourceLine(DIE *Die, DIType Ty) { /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DIObjCProperty Ty) { - // Verify type. - if (!Ty.isObjCProperty()) - return; + assert(Ty.isObjCProperty()); unsigned Line = Ty.getLineNumber(); if (Line == 0) @@ -445,9 +435,7 @@ void DwarfUnit::addSourceLine(DIE *Die, DIObjCProperty Ty) { /// addSourceLine - Add location information to specified debug information /// entry. void DwarfUnit::addSourceLine(DIE *Die, DINameSpace NS) { - // Verify namespace. - if (!NS.Verify()) - return; + assert(NS.Verify()); unsigned Line = NS.getLineNumber(); if (Line == 0) |