This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Use the source filename as the argument to .file, rather than the module ID.
ClosedPublic

Authored by pcc on Mar 3 2017, 11:08 AM.

Details

Summary

Using the module ID here is wrong for a couple of reasons:

  1. The module ID is not persisted, so we can end up with different object file contents given the same input file (for example if the same file is accessed via different paths).
  2. With ThinLTO the module ID field may contain the path to a bitcode file, which is incorrect, as the .file argument is supposed to contain the path to a source file.

Event Timeline

pcc created this revision.Mar 3 2017, 11:08 AM
mehdi_amini accepted this revision.Mar 15 2017, 8:35 AM

(Sorry for the delay I didn't see this one)

LGTM.

This revision is now accepted and ready to land.Mar 15 2017, 8:35 AM
This revision was automatically updated to reflect the committed changes.