Global variables don't have a corresponding llvm.dbg.declare, yet it is possible

to obtain debug info about them.
Introduce helpers to access debug info for global variables. Also introduce a
helper that works for both local and global variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66541 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Torok Edwin
2009-03-10 13:41:26 +00:00
parent c29f0c7dde
commit ff7d0e9509
5 changed files with 156 additions and 7 deletions

View File

@ -507,6 +507,12 @@ namespace llvm {
/// Finds the dbg.declare intrinsic corresponding to this value if any.
/// It looks through pointer casts too.
const DbgDeclareInst *findDbgDeclare(const Value *V, bool stripCasts = true);
/// Find the debug info descriptor corresponding to this global variable.
Value *findDbgGlobalDeclare(GlobalVariable *V);
bool getLocationInfo(const Value *V, std::string &DisplayName, std::string &Type,
unsigned &LineNo, std::string &File, std::string &Dir);
} // end namespace llvm
#endif