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" 47 : Directory(Directory.str()), Filename(Filename.str()),
48 CommandLine(
std::move(CommandLine)), Output(Output.str()){}
102 static std::unique_ptr<CompilationDatabase>
103 loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage);
109 static std::unique_ptr<CompilationDatabase>
110 autoDetectFromSource(StringRef SourceFile, std::string &ErrorMessage);
116 static std::unique_ptr<CompilationDatabase>
117 autoDetectFromDirectory(StringRef SourceDir, std::string &ErrorMessage);
128 virtual std::vector<CompileCommand> getCompileCommands(
129 StringRef FilePath)
const = 0;
135 virtual std::vector<std::string>
getAllFiles()
const {
return {}; }
146 virtual std::vector<CompileCommand> getAllCompileCommands()
const;
182 static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
183 int &Argc,
const char *
const *Argv, std::string &ErrorMsg,
188 static std::unique_ptr<FixedCompilationDatabase>
189 loadFromFile(StringRef Path, std::string &ErrorMsg);
200 std::vector<CompileCommand>
201 getCompileCommands(StringRef FilePath)
const override;
206 std::vector<CompileCommand> CompileCommands;
213 std::unique_ptr<CompilationDatabase>
219 std::unique_ptr<CompilationDatabase>
225 #endif // LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.