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" 47 : Directory(Directory.str()),
48 Filename(Filename.str()),
49 CommandLine(
std::move(CommandLine)),
50 Output(Output.str()){}
89 static std::unique_ptr<CompilationDatabase>
90 loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage);
96 static std::unique_ptr<CompilationDatabase>
97 autoDetectFromSource(StringRef SourceFile, std::string &ErrorMessage);
103 static std::unique_ptr<CompilationDatabase>
104 autoDetectFromDirectory(StringRef SourceDir, std::string &ErrorMessage);
115 virtual std::vector<CompileCommand> getCompileCommands(
116 StringRef FilePath)
const = 0;
122 virtual std::vector<std::string>
getAllFiles()
const {
return {}; }
133 virtual std::vector<CompileCommand> getAllCompileCommands()
const;
153 virtual std::unique_ptr<CompilationDatabase>
154 loadFromDirectory(StringRef
Directory, std::string &ErrorMessage) = 0;
190 static std::unique_ptr<FixedCompilationDatabase> loadFromCommandLine(
191 int &Argc,
const char *
const *Argv, std::string &ErrorMsg,
196 static std::unique_ptr<FixedCompilationDatabase>
197 loadFromFile(StringRef Path, std::string &ErrorMsg);
208 std::vector<CompileCommand>
209 getCompileCommands(StringRef FilePath)
const override;
214 std::vector<CompileCommand> CompileCommands;
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
Dataflow Directional Tag Classes.