mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Introduce the "@llvm.dbg.value" debug intrinsic.
The semantics of llvm.dbg.value are that starting from where it is executed, an offset into the specified user source variable is specified to get a new value. An example: call void @llvm.dbg.value(metadata !{ i32 7 }, i64 0, metadata !2) Here the user source variable associated with metadata #2 gets the value "i32 7" at offset 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90788 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1050,6 +1050,35 @@ Instruction *DIFactory::InsertDeclare(Value *Storage, DIVariable D,
|
||||
return CallInst::Create(DeclareFn, Args, Args+2, "", InsertAtEnd);
|
||||
}
|
||||
|
||||
/// InsertValue - Insert a new llvm.dbg.value intrinsic call.
|
||||
Instruction *DIFactory::InsertValue(Value *V, Value *Offset, DIVariable D,
|
||||
Instruction *InsertBefore) {
|
||||
assert(V && "no value passed to dbg.value");
|
||||
assert(Offset->getType() == Type::getInt64Ty(V->getContext()) &&
|
||||
"offset must be i64");
|
||||
if (!ValueFn)
|
||||
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
|
||||
|
||||
Value *Elts[] = { V };
|
||||
Value *Args[] = { MDNode::get(V->getContext(), Elts, 1), Offset,
|
||||
D.getNode() };
|
||||
return CallInst::Create(ValueFn, Args, Args+3, "", InsertBefore);
|
||||
}
|
||||
|
||||
/// InsertValue - Insert a new llvm.dbg.value intrinsic call.
|
||||
Instruction *DIFactory::InsertValue(Value *V, Value *Offset, DIVariable D,
|
||||
BasicBlock *InsertAtEnd) {
|
||||
assert(V && "no value passed to dbg.value");
|
||||
assert(Offset->getType() == Type::getInt64Ty(V->getContext()) &&
|
||||
"offset must be i64");
|
||||
if (!ValueFn)
|
||||
ValueFn = Intrinsic::getDeclaration(&M, Intrinsic::dbg_value);
|
||||
|
||||
Value *Elts[] = { V };
|
||||
Value *Args[] = { MDNode::get(V->getContext(), Elts, 1), Offset,
|
||||
D.getNode() };
|
||||
return CallInst::Create(ValueFn, Args, Args+3, "", InsertAtEnd);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// DebugInfoFinder implementations.
|
||||
|
Reference in New Issue
Block a user