diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2013-04-08 18:45:10 +0000 |
| commit | 809500fc2c13c8173a16b052304d983864e4a1e1 (patch) | |
| tree | 4fc2f184c499d106f29a386c452b49e5197bf63d /include/clang/Tooling/JSONCompilationDatabase.h | |
| parent | be7c9ec198dcdb5bf73a35bfbb00b3333cb87909 (diff) | |
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 d62ab5c5036e..e3f149bebc86 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; }; |
