llvm - printing line number of the source codes Stmt using clang libtooling -
hello i'm working clang libtooling. need take .c file , print names of functions present , lines function declaration in. in astrecursive class have function visitfunctiondecl , have found functions confused how find line number of stmts.
given functiondecl *f, f->getsourcerange() source range (beginning , end). given sourcerange sr, sr.getbegin() gives sourcelocation beginning of range.
look documentation / declarations of classes mentioned more details.
Comments
Post a Comment