1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Assert when debug intrinsic insert functions are passed empty arguments

llvm-svn: 94491
This commit is contained in:
Victor Hernandez 2010-01-26 02:07:38 +00:00
parent 548d00d77c
commit 648015f3a6

View File

@ -1033,6 +1033,8 @@ DILocation DIFactory::CreateLocation(unsigned LineNo, unsigned ColumnNo,
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call. /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
Instruction *InsertBefore) { Instruction *InsertBefore) {
assert(Storage && "no storage passed to dbg.declare");
assert(D.getNode() && "empty DIVariable passed to dbg.declare");
if (!DeclareFn) if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); 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. /// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D, Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
BasicBlock *InsertAtEnd) { BasicBlock *InsertAtEnd) {
assert(Storage && "no storage passed to dbg.declare");
assert(D.getNode() && "empty DIVariable passed to dbg.declare");
if (!DeclareFn) if (!DeclareFn)
DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare); DeclareFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_declare);
@ -1057,6 +1061,7 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset,
DIVariable D, DIVariable D,
Instruction *InsertBefore) { Instruction *InsertBefore) {
assert(V && "no value passed to dbg.value"); assert(V && "no value passed to dbg.value");
assert(D.getNode() && "empty DIVariable passed to dbg.value");
if (!ValueFn) if (!ValueFn)
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value); ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
@ -1071,6 +1076,7 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset,
DIVariable D, DIVariable D,
BasicBlock *InsertAtEnd) { BasicBlock *InsertAtEnd) {
assert(V && "no value passed to dbg.value"); assert(V && "no value passed to dbg.value");
assert(D.getNode() && "empty DIVariable passed to dbg.value");
if (!ValueFn) if (!ValueFn)
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value); ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);