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/Transforms/Utils/Local.cpp | |
parent | d2a1a519965155c3509204498849126c59ce73de (diff) | |
download | llvm-d4a19a396d06ba327838d7ebd936c9d4829bca78.zip llvm-d4a19a396d06ba327838d7ebd936c9d4829bca78.tar.gz llvm-d4a19a396d06ba327838d7ebd936c9d4829bca78.tar.bz2 |
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/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 1c9760e..5672a36 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1000,8 +1000,7 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI, StoreInst *SI, DIBuilder &Builder) { DIVariable DIVar = DDI->getVariable(); DIExpression DIExpr = DDI->getExpression(); - if (!DIVar) - return false; + assert(DIVar && "Missing variable"); if (LdStHasDebugValue(DIVar, SI)) return true; @@ -1028,8 +1027,7 @@ bool llvm::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI, LoadInst *LI, DIBuilder &Builder) { DIVariable DIVar = DDI->getVariable(); DIExpression DIExpr = DDI->getExpression(); - if (!DIVar) - return false; + assert(DIVar && "Missing variable"); if (LdStHasDebugValue(DIVar, LI)) return true; @@ -1107,8 +1105,7 @@ bool llvm::replaceDbgDeclareForAlloca(AllocaInst *AI, Value *NewAllocaAddress, DebugLoc Loc = DDI->getDebugLoc(); DIVariable DIVar = DDI->getVariable(); DIExpression DIExpr = DDI->getExpression(); - if (!DIVar) - return false; + assert(DIVar && "Missing variable"); if (Deref) { // Create a copy of the original DIDescriptor for user variable, prepending |