Lines Matching +full:cmd +full:- +full:db
1 //===- CompilationDatabase.cpp --------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
15 //===----------------------------------------------------------------------===//
71 if (std::unique_ptr<CompilationDatabase> DB = in loadFromDirectory() local
72 Plugin->loadFromDirectory(BuildDirectory, DatabaseErrorMessage)) in loadFromDirectory()
73 return DB; in loadFromDirectory()
87 if (std::unique_ptr<CompilationDatabase> DB = in findCompilationDatabaseFromDirectory() local
89 return DB; in findCompilationDatabaseFromDirectory()
109 std::unique_ptr<CompilationDatabase> DB = in autoDetectFromSource() local
112 if (!DB) in autoDetectFromSource()
113 ErrorMessage = ("Could not auto-detect compilation database for file \"" + in autoDetectFromSource()
115 return DB; in autoDetectFromSource()
123 std::unique_ptr<CompilationDatabase> DB = in autoDetectFromDirectory() local
126 if (!DB) in autoDetectFromDirectory()
127 ErrorMessage = ("Could not auto-detect compilation database from directory \"" + in autoDetectFromDirectory()
129 return DB; in autoDetectFromDirectory()
157 switch (A->getKind()) { in runImpl()
166 Inputs.push_back(std::string(IA->getInputArg().getSpelling())); in runImpl()
175 for (const driver::Action *AI : A->inputs()) in runImpl()
203 // Filter of tools unused flags such as -no-integrated-as and -Wa,*.
208 return (S == "-no-integrated-as") || S.starts_with("-Wa,"); in operator ()()
218 llvm::sys::path::append(ClangToolPath, "clang-tool"); in GetClangToolCommand()
224 /// Strips any positional args and possible argv[0] from a command-line
242 /// contains an option like -E or -version).
259 NewDriver->setCheckInputsExist(false); in stripPositionalArgs()
266 // By adding -c, we force the driver to treat compilation as the last phase. in stripPositionalArgs()
267 // It will then issue warnings via Diagnostics about un-used options that in stripPositionalArgs()
270 // insertng a new argv[0] above. All un-used options get collected by in stripPositionalArgs()
272 Args.push_back("-c"); in stripPositionalArgs()
276 // prevents compilation, e.g. -E or something like -version, we may still end in stripPositionalArgs()
283 NewDriver->BuildCompilation(Args)); in stripPositionalArgs()
287 const driver::JobList &Jobs = Compilation->getJobs(); in stripPositionalArgs()
291 for (const auto &Cmd : Jobs) { in stripPositionalArgs() local
294 // -flto* flags make the BackendJobClass, which still needs analyzer. in stripPositionalArgs()
295 if (Cmd.getSource().getKind() == driver::Action::AssembleJobClass || in stripPositionalArgs()
296 Cmd.getSource().getKind() == driver::Action::BackendJobClass || in stripPositionalArgs()
297 Cmd.getSource().getKind() == driver::Action::CompileJobClass || in stripPositionalArgs()
298 Cmd.getSource().getKind() == driver::Action::PrecompileJobClass) { in stripPositionalArgs()
299 CompileAnalyzer.run(&Cmd.getSource()); in stripPositionalArgs()
316 // Remove the -c add above as well. It will be at the end right now. in stripPositionalArgs()
317 assert(strcmp(*(End - 1), "-c") == 0); in stripPositionalArgs()
318 --End; in stripPositionalArgs()
332 const char *const *DoubleDash = std::find(Argv, Argv + Argc, StringRef("--")); in loadFromCommandLine()
336 Argc = DoubleDash - Argv; in loadFromCommandLine()
354 (*File)->getBuffer(), ErrorMsg); in loadFromFile()
405 X("fixed-compilation-database", "Reads plain-text flags file");