aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp b/contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp
index 1e19e68633d2..af18194ae0fe 100644
--- a/contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp
+++ b/contrib/llvm-project/clang/lib/Tooling/CompilationDatabase.cpp
@@ -37,11 +37,11 @@
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ErrorOr.h"
-#include "llvm/Support/Host.h"
#include "llvm/Support/LineIterator.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/TargetParser/Host.h"
#include <algorithm>
#include <cassert>
#include <cstring>
@@ -156,6 +156,7 @@ private:
bool CollectChildren = Collect;
switch (A->getKind()) {
case driver::Action::CompileJobClass:
+ case driver::Action::PrecompileJobClass:
CollectChildren = true;
break;
@@ -204,7 +205,7 @@ public:
// which don't support these options.
struct FilterUnusedFlags {
bool operator() (StringRef S) {
- return (S == "-no-integrated-as") || S.startswith("-Wa,");
+ return (S == "-no-integrated-as") || S.starts_with("-Wa,");
}
};
@@ -215,7 +216,7 @@ std::string GetClangToolCommand() {
SmallString<128> ClangToolPath;
ClangToolPath = llvm::sys::path::parent_path(ClangExecutable);
llvm::sys::path::append(ClangToolPath, "clang-tool");
- return std::string(ClangToolPath.str());
+ return std::string(ClangToolPath);
}
} // namespace
@@ -293,7 +294,8 @@ static bool stripPositionalArgs(std::vector<const char *> Args,
// -flto* flags make the BackendJobClass, which still needs analyzer.
if (Cmd.getSource().getKind() == driver::Action::AssembleJobClass ||
Cmd.getSource().getKind() == driver::Action::BackendJobClass ||
- Cmd.getSource().getKind() == driver::Action::CompileJobClass) {
+ Cmd.getSource().getKind() == driver::Action::CompileJobClass ||
+ Cmd.getSource().getKind() == driver::Action::PrecompileJobClass) {
CompileAnalyzer.run(&Cmd.getSource());
}
}