clang-modernize: fix invalid assignment in findClangApplyReplacements()

Summary:
When clang-apply-replacements wasn't in the PATH or sitting next to
clang-modernize, findClangApplyReplacements() was finding the wrong path
(pointing to clang-modernize instead of nothing).

See the related PR at http://llvm.org/bugs/show_bug.cgi?id=18421

Reviewers: klimek

CC: silvas, cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D3217

llvm-svn: 205136
This commit is contained in:
Guillaume Papin
2014-03-30 10:50:25 +00:00
parent 81f7061065
commit 46113d0e22

View File

@@ -31,8 +31,8 @@ bool ReplacementHandling::findClangApplyReplacements(const char *Argv0) {
return true;
static int StaticSymbol;
CARPath = fs::getMainExecutable(Argv0, &StaticSymbol);
SmallString<128> TestPath = path::parent_path(CARPath);
std::string ClangModernizePath = fs::getMainExecutable(Argv0, &StaticSymbol);
SmallString<128> TestPath = path::parent_path(ClangModernizePath);
path::append(TestPath, "clang-apply-replacements");
if (fs::can_execute(Twine(TestPath)))
CARPath = TestPath.str();