diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-21 18:24:23 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-21 18:24:23 +0000 |
| commit | d4a19a396d06ba327838d7ebd936c9d4829bca78 (patch) | |
| tree | 00954ac633758a0a490dcd6d14456851387e946d /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
| parent | d2a1a519965155c3509204498849126c59ce73de (diff) | |
| download | bcm5719-llvm-d4a19a396d06ba327838d7ebd936c9d4829bca78.tar.gz bcm5719-llvm-d4a19a396d06ba327838d7ebd936c9d4829bca78.zip | |
DebugInfo: Assert dbg.declare/value insts are valid
Remove early returns for when `getVariable()` is null, and just assert
that it never happens. The Verifier already confirms that there's a
valid variable on these intrinsics, so we should assume the debug info
isn't broken. I also updated a check for a `!dbg` attachment, which the
Verifier similarly guarantees.
llvm-svn: 235400
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index bb40326ba2d..b7882329955 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -202,8 +202,9 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, // during the initial isel pass through the IR so that it is done // in a predictable order. if (const DbgDeclareInst *DI = dyn_cast<DbgDeclareInst>(I)) { - DIVariable DIVar = DI->getVariable(); - if (MMI.hasDebugInfo() && DIVar && DI->getDebugLoc()) { + assert(DI->getVariable() && "Missing variable"); + assert(DI->getDebugLoc() && "Missing location"); + if (MMI.hasDebugInfo()) { // Don't handle byval struct arguments or VLAs, for example. // Non-byval arguments are handled here (they refer to the stack // temporary alloca at this point). |

