<div dir="ltr"><div dir="ltr" style><div style="font-family:arial,sans-serif;font-size:13px">Hi Daniel,</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><blockquote class="gmail_quote" style="font-family:arial,sans-serif;font-size:13px;margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I have been calling runClangTidy directly, and I finally am (mostly) getting the results that I expect.<br>ClangTidyMessage has the position as an offset into the file.  Is there a function in Clang/LLVM that will convert this to a line and column?</blockquote><div style="font-family:arial,sans-serif;font-size:13px">Take a look at SourceManager methods like getSpellingLineNumber</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">In a clang-tidy check, you can write something along the lines:</div><div style><font face="arial, sans-serif">  const SourceManager &SM = *Result.SourceManager;</font><br></div><div style><span style="font-family:arial,sans-serif;font-size:13px">  SourceLocation Loc = ...;</span><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>  bool Invalid = false;</div><div>  unsigned LineNo = SM.getSpellingLineNumber(Loc, &Invalid);</div><div>  unsigned ColNo = SM.getSpellingColumnNumber(Loc, &Invalid);<br></div><div><br></div><div>Cheers,</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div><div class="gmail_signature"><div dir="ltr"><div style="font-family:arial;font-size:small"><div>Marek Kurdej</div>--<br>Ph.D. candidate</div></div></div></div>
</div>