Debug Info Finder|Verifier: handle DbgLoc attached to instructions.
authorManman Ren <manman.ren@gmail.com>
Thu, 1 Aug 2013 20:52:39 +0000 (20:52 +0000)
committerManman Ren <manman.ren@gmail.com>
Thu, 1 Aug 2013 20:52:39 +0000 (20:52 +0000)
commit4c065e779c208377ea504d6d1a0eed19c298e1bb
tree8ad22b6372f0947f9efb861f63b8583244b4524b
parent4a5b8958a81e2e91ed08703789353424f55846cd
Debug Info Finder|Verifier: handle DbgLoc attached to instructions.

Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.

llvm-svn: 187609
17 files changed:
llvm/include/llvm/DebugInfo.h
llvm/lib/IR/DebugInfo.cpp
llvm/lib/IR/Verifier.cpp
llvm/test/BugPoint/metadata.ll
llvm/test/CodeGen/ARM/2010-04-15-ScavengerDebugValue.ll
llvm/test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
llvm/test/CodeGen/X86/2010-01-18-DbgValue.ll
llvm/test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll
llvm/test/DebugInfo/2010-01-05-DbgScope.ll
llvm/test/DebugInfo/2010-05-03-DisableFramePtr.ll
llvm/test/DebugInfo/2010-05-10-MultipleCU.ll
llvm/test/DebugInfo/X86/2010-04-13-PubType.ll
llvm/test/Feature/md_on_instruction.ll
llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
llvm/test/Transforms/GlobalOpt/2009-03-05-dbg.ll
llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
llvm/test/Transforms/StripSymbols/2010-07-01-DeadDbgInfo.ll