diff options
Diffstat (limited to 'include/clang/Tooling/JSONCompilationDatabase.h')
-rw-r--r-- | include/clang/Tooling/JSONCompilationDatabase.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/clang/Tooling/JSONCompilationDatabase.h b/include/clang/Tooling/JSONCompilationDatabase.h index d62ab5c..e3f149b 100644 --- a/include/clang/Tooling/JSONCompilationDatabase.h +++ b/include/clang/Tooling/JSONCompilationDatabase.h @@ -75,6 +75,10 @@ public: /// These are the 'file' entries of the JSON objects. virtual std::vector<std::string> getAllFiles() const; + /// \brief Returns all compile commands for all the files in the compilation + /// database. + virtual std::vector<CompileCommand> getAllCompileCommands() const; + private: /// \brief Constructs a JSON compilation database on a memory buffer. JSONCompilationDatabase(llvm::MemoryBuffer *Database) @@ -91,12 +95,16 @@ private: typedef std::pair<llvm::yaml::ScalarNode*, llvm::yaml::ScalarNode*> CompileCommandRef; + /// \brief Converts the given array of CompileCommandRefs to CompileCommands. + void getCommands(ArrayRef<CompileCommandRef> CommandsRef, + std::vector<CompileCommand> &Commands) const; + // Maps file paths to the compile command lines for that file. llvm::StringMap< std::vector<CompileCommandRef> > IndexByFile; FileMatchTrie MatchTrie; - llvm::OwningPtr<llvm::MemoryBuffer> Database; + OwningPtr<llvm::MemoryBuffer> Database; llvm::SourceMgr SM; llvm::yaml::Stream YAMLStream; }; |