Page MenuHomePhabricator

Fix depfile name construction
ClosedPublic

Authored by LukeCheeseman on Sep 13 2019, 2:33 AM.

Details

Summary
  • When using -o, the provided filename is using for constructing the depfile name (when -MMD is passed).
  • The logic looks for the rightmost '.' character and replaces what comes after with 'd'.
  • This works incorrectly when the filename has no extension and the directories have '.' in them (e.g. out.dir/test)
  • This replaces the funciton to just llvm::sys::path functionality

Diff Detail

Repository
rL LLVM

Event Timeline

LukeCheeseman created this revision.Sep 13 2019, 2:33 AM
LukeCheeseman set the repository for this revision to rC Clang.
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2019, 2:34 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
chill added a reviewer: chill.Sep 13 2019, 2:46 AM
chill added a subscriber: chill.
chill added inline comments.
clang/test/Driver/metadata-with-dots.c
2 ↗(On Diff #220058)

Is this going to ruin on Windows ?

4–6 ↗(On Diff #220058)

And these ?

  • Add a requires shell
chill accepted this revision.Sep 13 2019, 3:33 AM

LGTM

This revision is now accepted and ready to land.Sep 13 2019, 3:33 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 13 2019, 6:14 AM
thakis added inline comments.
cfe/trunk/lib/Driver/ToolChains/Clang.cpp
6076

Can you use llvm::Twine() instead of std::string() here?