diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-05-23 13:50:43 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-05-23 13:50:43 +0000 |
commit | a1928042938602aefa897d607de26515ca597ed4 (patch) | |
tree | bfb6a1c9c09ff89af54f32ad418817e7c6936a8c | |
parent | f01af686a26072f98f1dff8f2a9d9c6e8d1df67d (diff) | |
download | bcm5719-llvm-a1928042938602aefa897d607de26515ca597ed4.tar.gz bcm5719-llvm-a1928042938602aefa897d607de26515ca597ed4.zip |
[Tooling][libclang] Remove unused CompilationDatabase::MappedSources
Summary:
This field is never assigned to and it's only ever read from libclang.
This patch removes it and adapts libclang to return constants.
Reviewers: klimek, bkramer
Reviewed By: klimek
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32351
llvm-svn: 303635
-rw-r--r-- | clang/include/clang/Tooling/CompilationDatabase.h | 10 | ||||
-rw-r--r-- | clang/tools/libclang/CXCompilationDatabase.cpp | 31 |
2 files changed, 9 insertions, 32 deletions
diff --git a/clang/include/clang/Tooling/CompilationDatabase.h b/clang/include/clang/Tooling/CompilationDatabase.h index 4611d3cdae5..7f3f5869841 100644 --- a/clang/include/clang/Tooling/CompilationDatabase.h +++ b/clang/include/clang/Tooling/CompilationDatabase.h @@ -60,16 +60,6 @@ struct CompileCommand { /// The output file associated with the command. std::string Output; - - /// \brief An optional mapping from each file's path to its content for all - /// files needed for the compilation that are not available via the file - /// system. - /// - /// Note that a tool implementation is required to fall back to the file - /// system if a source file is not provided in the mapped sources, as - /// compilation databases will usually not provide all files in mapped sources - /// for performance reasons. - std::vector<std::pair<std::string, std::string> > MappedSources; }; /// \brief Interface for compilation databases. diff --git a/clang/tools/libclang/CXCompilationDatabase.cpp b/clang/tools/libclang/CXCompilationDatabase.cpp index c122ec8a6db..2ca532659d3 100644 --- a/clang/tools/libclang/CXCompilationDatabase.cpp +++ b/clang/tools/libclang/CXCompilationDatabase.cpp @@ -145,36 +145,23 @@ clang_CompileCommand_getArg(CXCompileCommand CCmd, unsigned Arg) unsigned clang_CompileCommand_getNumMappedSources(CXCompileCommand CCmd) { - if (!CCmd) - return 0; - - return static_cast<CompileCommand *>(CCmd)->MappedSources.size(); + // Left here for backward compatibility. No mapped sources exists in the C++ + // backend anymore. + return 0; } CXString clang_CompileCommand_getMappedSourcePath(CXCompileCommand CCmd, unsigned I) { - if (!CCmd) - return cxstring::createNull(); - - CompileCommand *Cmd = static_cast<CompileCommand *>(CCmd); - - if (I >= Cmd->MappedSources.size()) - return cxstring::createNull(); - - return cxstring::createRef(Cmd->MappedSources[I].first.c_str()); + // Left here for backward compatibility. No mapped sources exists in the C++ + // backend anymore. + return cxstring::createNull(); } CXString clang_CompileCommand_getMappedSourceContent(CXCompileCommand CCmd, unsigned I) { - if (!CCmd) - return cxstring::createNull(); - - CompileCommand *Cmd = static_cast<CompileCommand *>(CCmd); - - if (I >= Cmd->MappedSources.size()) - return cxstring::createNull(); - - return cxstring::createRef(Cmd->MappedSources[I].second.c_str()); + // Left here for backward compatibility. No mapped sources exists in the C++ + // backend anymore. + return cxstring::createNull(); } |