From 7a55481fa4605d27f4096a4d9f678bfb20df9f7e Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 28 Sep 2010 18:08:20 +0000 Subject: Provide an interface to let FEs anchor debug info for types. llvm-svn: 114969 --- llvm/lib/Analysis/DebugInfo.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'llvm/lib/Analysis/DebugInfo.cpp') diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index fec269e2205..dba7b8f2422 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -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. //===----------------------------------------------------------------------===// -- cgit v1.2.3