mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-03 13:31:05 +00:00
Provide an interface to let FEs anchor debug info for types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c2ec02c183
commit
1a7ca0354a
@ -763,6 +763,11 @@ namespace llvm {
|
||||
/// InsertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
|
||||
Instruction *InsertDbgValueIntrinsic(llvm::Value *V, uint64_t Offset,
|
||||
DIVariable D, Instruction *InsertBefore);
|
||||
|
||||
// RecordType - Record DIType in a module such that it is not lost even if
|
||||
// it is not referenced through debug info anchors.
|
||||
void RecordType(DIType T);
|
||||
|
||||
private:
|
||||
Constant *GetTagConstant(unsigned TAG);
|
||||
};
|
||||
|
@ -1306,6 +1306,14 @@ Instruction *DIFactory::InsertDbgValueIntrinsic(Value *V, uint64_t Offset,
|
||||
return CallInst::Create(ValueFn, Args, Args+3, "", InsertAtEnd);
|
||||
}
|
||||
|
||||
// RecordType - Record DIType in a module such that it is not lost even if
|
||||
// it is not referenced through debug info anchors.
|
||||
void DIFactory::RecordType(DIType T) {
|
||||
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.ty");
|
||||
NMD->addOperand(T);
|
||||
}
|
||||
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// DebugInfoFinder implementations.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -2056,6 +2056,10 @@ void DwarfDebug::beginModule(Module *M) {
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i)
|
||||
getOrCreateTypeDIE(DIType(NMD->getOperand(i)));
|
||||
|
||||
if (NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.ty"))
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i)
|
||||
getOrCreateTypeDIE(DIType(NMD->getOperand(i)));
|
||||
|
||||
// Prime section data.
|
||||
SectionMap.insert(Asm->getObjFileLowering().getTextSection());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user