28 #ifndef LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H 29 #define LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H 32 #include "llvm/ADT/ArrayRef.h" 33 #include "llvm/ADT/StringRef.h" 34 #include "llvm/ADT/Twine.h" 48 : Directory(Directory.str()), Filename(Filename.str()),
49 CommandLine(
std::move(CommandLine)), Output(Output.str()){}
97 static std::unique_ptr<CompilationDatabase>
98 loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage);
104 static std::unique_ptr<CompilationDatabase>
105 autoDetectFromSource(StringRef SourceFile, std::string &ErrorMessage);
111 static std::unique_ptr<CompilationDatabase>
112 autoDetectFromDirectory(StringRef SourceDir, std::string &ErrorMessage);
123 virtual std::vector<CompileCommand> getCompileCommands(
124 StringRef FilePath)
const = 0;
130 virtual std::vector<std::string>
getAllFiles()
const {
return {}; }
141 virtual std::vector<CompileCommand> getAllCompileCommands()
const;
161 virtual std::unique_ptr<CompilationDatabase>
162 loadFromDirectory(StringRef
Directory, std::string &ErrorMessage) = 0;
198 static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
199 int &Argc,
const char *
const *Argv, std::string &ErrorMsg,
204 static std::unique_ptr<FixedCompilationDatabase>
205 loadFromFile(StringRef Path, std::string &ErrorMsg);
216 std::vector<CompileCommand>
217 getCompileCommands(StringRef FilePath)
const override;
222 std::vector<CompileCommand> CompileCommands;
229 std::unique_ptr<CompilationDatabase>
235 #endif // LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.