diff options
author | Vlad Tsyrklevich <vlad@tsyrklevich.net> | 2019-01-16 00:37:39 +0000 |
---|---|---|
committer | Vlad Tsyrklevich <vlad@tsyrklevich.net> | 2019-01-16 00:37:39 +0000 |
commit | e3226737ce014d6a8e5b5106f20303dd51048c6e (patch) | |
tree | 178a4fea2a8590c7935925f1d156f07ef92a0a78 /clang/lib/Tooling/CompilationDatabase.cpp | |
parent | 436735c3fe8e11ab6535c6b323113ae2c4e1a307 (diff) | |
download | llvm-e3226737ce014d6a8e5b5106f20303dd51048c6e.zip llvm-e3226737ce014d6a8e5b5106f20303dd51048c6e.tar.gz llvm-e3226737ce014d6a8e5b5106f20303dd51048c6e.tar.bz2 |
Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database."
This reverts commits r351222 and r351229, they were causing ASan/MSan failures
on the sanitizer bots.
llvm-svn: 351282
Diffstat (limited to 'clang/lib/Tooling/CompilationDatabase.cpp')
-rw-r--r-- | clang/lib/Tooling/CompilationDatabase.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index 032250b..246d3c0 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -227,16 +227,6 @@ struct FilterUnusedFlags { } }; -std::string GetClangToolCommand() { - static int Dummy; - std::string ClangExecutable = - llvm::sys::fs::getMainExecutable("clang", (void *)&Dummy); - SmallString<128> ClangToolPath; - ClangToolPath = llvm::sys::path::parent_path(ClangExecutable); - llvm::sys::path::append(ClangToolPath, "clang-tool"); - return ClangToolPath.str(); -} - } // namespace /// Strips any positional args and possible argv[0] from a command-line @@ -276,9 +266,9 @@ static bool stripPositionalArgs(std::vector<const char *> Args, Diagnostics)); NewDriver->setCheckInputsExist(false); - // This becomes the new argv[0]. The value is used to detect libc++ include - // dirs on Mac, it isn't used for other platforms. - Args.insert(Args.begin(), GetClangToolCommand().c_str()); + // This becomes the new argv[0]. The value is actually not important as it + // isn't used for invoking Tools. + Args.insert(Args.begin(), "clang-tool"); // By adding -c, we force the driver to treat compilation as the last phase. // It will then issue warnings via Diagnostics about un-used options that @@ -376,7 +366,7 @@ FixedCompilationDatabase::loadFromFile(StringRef Path, std::string &ErrorMsg) { FixedCompilationDatabase:: FixedCompilationDatabase(Twine Directory, ArrayRef<std::string> CommandLine) { - std::vector<std::string> ToolCommandLine(1, GetClangToolCommand()); + std::vector<std::string> ToolCommandLine(1, "clang-tool"); ToolCommandLine.insert(ToolCommandLine.end(), CommandLine.begin(), CommandLine.end()); CompileCommands.emplace_back(Directory, StringRef(), |