From a1928042938602aefa897d607de26515ca597ed4 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Tue, 23 May 2017 13:50:43 +0000 Subject: [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 --- clang/tools/libclang/CXCompilationDatabase.cpp | 31 ++++++++------------------ 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'clang/tools/libclang/CXCompilationDatabase.cpp') 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(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(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(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(); } -- cgit v1.2.3