diff options
author | Yaron Keren <yaron.keren@gmail.com> | 2017-01-14 21:12:08 +0000 |
---|---|---|
committer | Yaron Keren <yaron.keren@gmail.com> | 2017-01-14 21:12:08 +0000 |
commit | fa3674017a7df04630112947fd2de969ac51f7ec (patch) | |
tree | 8bfac71301a1d29a817abda89132f9516a0c914a /clang/lib/Frontend/DependencyFile.cpp | |
parent | 6d28500ff950003a0b8ea8709fc62957603af456 (diff) | |
download | llvm-fa3674017a7df04630112947fd2de969ac51f7ec.zip llvm-fa3674017a7df04630112947fd2de969ac51f7ec.tar.gz llvm-fa3674017a7df04630112947fd2de969ac51f7ec.tar.bz2 |
Fix PR31644 introduced by r287138 and add a regression test.
Thanks Dimitry Andric for the report and fix!
llvm-svn: 292032
Diffstat (limited to 'clang/lib/Frontend/DependencyFile.cpp')
-rw-r--r-- | clang/lib/Frontend/DependencyFile.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 059f116..bd14c53 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -447,9 +447,9 @@ void DFGImpl::OutputDependencyFile() { // Create phony targets if requested. if (PhonyTarget && !Files.empty()) { // Skip the first entry, this is always the input file itself. - for (StringRef File : Files) { + for (auto I = Files.begin() + 1, E = Files.end(); I != E; ++I) { OS << '\n'; - PrintFilename(OS, File, OutputFormat); + PrintFilename(OS, *I, OutputFormat); OS << ":\n"; } } |