[llvm-commits] [llvm] r94491 - /llvm/trunk/lib/Analysis/DebugInfo.cpp
Victor Hernandez
vhernandez at apple.com
Mon Jan 25 18:07:38 PST 2010
Author: hernande
Date: Mon Jan 25 20:07:38 2010
New Revision: 94491
URL: http://llvm.org/viewvc/llvm-project?rev=94491&view=rev
Log:
Assert when debug intrinsic insert functions are passed empty arguments
Modified:
llvm/trunk/lib/Analysis/DebugInfo.cpp
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=94491&r1=94490&r2=94491&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jan 25 20:07:38 2010
@@ -1033,6 +1033,8 @@
/// 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 @@
/// 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 @@
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 @@
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);
More information about the llvm-commits
mailing list