On Fri, May 1, 2015 at 3:22 PM, Geoff Berry <[email protected]> wrote:

> Index: lib/CodeGen/CodeGenAction.cpp
> ===================================================================
> --- lib/CodeGen/CodeGenAction.cpp
> +++ lib/CodeGen/CodeGenAction.cpp
> @@ -434,7 +434,13 @@
>    FileManager &FileMgr = SourceMgr.getFileManager();
>    StringRef Filename;
>    unsigned Line, Column;
> -  D.getLocation(&Filename, &Line, &Column);
> +  if (D.isLocationAvailable())
> +    D.getLocation(&Filename, &Line, &Column);
> +  else {
> +    Filename = "<unknown>";
> +    Line = 0;
> +    Column = 0;
> +  }

Odd, this code used to unavailable locations (a few lines below your
new guard). I suppose something changed in getLocation() that's now
causing it to fail. In that case, could you just fold the new test in
the code below?

  // If a location isn't available, try to approximate it using the associated
  // function definition. We use the definition's right brace to differentiate
  // from diagnostics that genuinely relate to the function itself.
  FullSourceLoc Loc(DILoc, SourceMgr);
  if (Loc.isInvalid())
[ ... ]


Diego.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to