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;
177 static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
178 int &Argc,
const char *
const *Argv, std::string &ErrorMsg,
183 static std::unique_ptr<FixedCompilationDatabase>
184 loadFromFile(StringRef Path, std::string &ErrorMsg);
195 std::vector<CompileCommand>
196 getCompileCommands(StringRef FilePath)
const override;
201 std::vector<CompileCommand> CompileCommands;
208 std::unique_ptr<CompilationDatabase>
214 #endif // LLVM_CLANG_TOOLING_COMPILATIONDATABASE_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.