27 #ifndef LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H 28 #define LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H 31 #include "llvm/ADT/ArrayRef.h" 32 #include "llvm/ADT/StringRef.h" 33 #include "llvm/ADT/Twine.h" 34 #include "llvm/Support/VirtualFileSystem.h" 48 : Directory(Directory.str()), Filename(Filename.str()),
49 CommandLine(
std::move(CommandLine)), Output(Output.str()){}
103 static std::unique_ptr<CompilationDatabase>
104 loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage);
110 static std::unique_ptr<CompilationDatabase>
111 autoDetectFromSource(StringRef SourceFile, std::string &ErrorMessage);
117 static std::unique_ptr<CompilationDatabase>
118 autoDetectFromDirectory(StringRef SourceDir, std::string &ErrorMessage);
129 virtual std::vector<CompileCommand> getCompileCommands(
130 StringRef FilePath)
const = 0;
136 virtual std::vector<std::string>
getAllFiles()
const {
return {}; }
147 virtual std::vector<CompileCommand> getAllCompileCommands()
const;
183 static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
184 int &Argc,
const char *
const *Argv, std::string &ErrorMsg,
189 static std::unique_ptr<FixedCompilationDatabase>
190 loadFromFile(StringRef Path, std::string &ErrorMsg);
201 std::vector<CompileCommand>
202 getCompileCommands(StringRef FilePath)
const override;
207 std::vector<CompileCommand> CompileCommands;
214 std::unique_ptr<CompilationDatabase>
220 std::unique_ptr<CompilationDatabase>
225 std::unique_ptr<CompilationDatabase>
232 #endif // LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.