diff options
| author | Victor Hernandez <vhernandez@apple.com> | 2010-01-26 02:07:38 +0000 |
|---|---|---|
| committer | Victor Hernandez <vhernandez@apple.com> | 2010-01-26 02:07:38 +0000 |
| commit | 907bdbb6be6e9c94fdb5278dec38820524f952f6 (patch) | |
| tree | c0977285fc7064fdab8b61d4d241700551959bcc /llvm/lib | |
| parent | 555f61bf58258b7741e89f9552f6ee7236b236d9 (diff) | |
| download | bcm5719-llvm-907bdbb6be6e9c94fdb5278dec38820524f952f6.tar.gz bcm5719-llvm-907bdbb6be6e9c94fdb5278dec38820524f952f6.zip | |
Assert when debug intrinsic insert functions are passed empty arguments
llvm-svn: 94491
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index 4ba837a6900..8bed36ee526 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -1033,6 +1033,8 @@ DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo, /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, Instruction *InsertBefore) { + assert(Storage && "no storage passed to dbg.declare"); + assert(D.getNode() && "empty DIVariable passed to dbg.declare"); if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); @@ -1044,6 +1046,8 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, BasicBlock *InsertAtEnd) { + assert(Storage && "no storage passed to dbg.declare"); + assert(D.getNode() && "empty DIVariable passed to dbg.declare"); if (!DeclareFn) DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); @@ -1057,6 +1061,7 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset, DIVariable D, Instruction *InsertBefore) { assert(V && "no value passed to dbg.value"); + assert(D.getNode() && "empty DIVariable passed to dbg.value"); if (!ValueFn) ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value); @@ -1071,6 +1076,7 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset, DIVariable D, BasicBlock *InsertAtEnd) { assert(V && "no value passed to dbg.value"); + assert(D.getNode() && "empty DIVariable passed to dbg.value"); if (!ValueFn) ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value); |

