This is an archive of the discontinued LLVM Phabricator instance.

Fix '-main-file-name <name>' so that it is used for the ModuleID.
ClosedPublic

Authored by robertlytton on May 20 2014, 1:55 AM.

Details

Reviewers
rsmith
Summary

Previously, you could not specify the original file name when passing a preprocessed file into the compiler
Now you can use 'clang -Xclang -main-file-name -Xclang <original file name> ...'
Or 'clang -cc1 -main-file-name <original file name> ...'

Diff Detail

Event Timeline

robertlytton retitled this revision from to Fix '-main-file-name <name>' so that it is used for the ModuleID..
robertlytton updated this object.

Hi Richard,
Would you be able to review, or suggest who should?
Robert

robertlytton added a subscriber: Unknown Object (MLST).May 20 2014, 2:00 AM
rsmith accepted this revision.May 22 2014, 6:18 PM
rsmith edited edge metadata.

LGTM with tiny fixes.

lib/CodeGen/CodeGenAction.cpp
554–557

Per coding convention, this should be named MainFileName.

test/Misc/main-file-name.c
1

This test should be in tests/CodeGen.

This revision is now accepted and ready to land.May 22 2014, 6:18 PM

also 'mainFileName' should be initial capital.

robertlytton closed this revision.May 23 2014, 12:15 AM