-Rpass causing internal error with #line directives

Diego Novillo dnovillo at google.com
Tue May 6 09:15:52 PDT 2014


This code will cause an internal error when compiled with -Rpass=inline

int foo(int j) { return j / 10; }
#line 4242 "path/to/autogen-src.dat"
int baz(int j) { return foo(j) * 3; }


$ clang -O2 -g -Rpass=inline -c foo.cc

The problem triggers when BackendConsumer::OptimizationRemarkHandler()
calls SourceMgr.translateFileLineCol(FileMgr.getFile(Filename)...).

There is no entry in FileMgr for "path/to/autogen-src.dat", so
translateFileLineCol() ICEs.

I could check whether FileMgr.getFile() returns a nil entry and show no
source location here, but we arguably have a good location for that inline
decision, so I would like to show path/to/autogen-src.dat:4242 there.

Is there a way to get at that entry?


Thanks. Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140506/f55ff857/attachment.html>


More information about the cfe-commits mailing list