This revision was automatically updated to reflect the committed changes. Closed by commit rL303635: [Tooling][libclang] Remove unused CompilationDatabase::MappedSources (authored by krasimir).
Changed prior to commit: https://reviews.llvm.org/D32351?vs=96138&id=99905#toc Repository: rL LLVM https://reviews.llvm.org/D32351 Files: cfe/trunk/include/clang/Tooling/CompilationDatabase.h cfe/trunk/tools/libclang/CXCompilationDatabase.cpp Index: cfe/trunk/tools/libclang/CXCompilationDatabase.cpp =================================================================== --- cfe/trunk/tools/libclang/CXCompilationDatabase.cpp +++ cfe/trunk/tools/libclang/CXCompilationDatabase.cpp @@ -145,36 +145,23 @@ 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(); } Index: cfe/trunk/include/clang/Tooling/CompilationDatabase.h =================================================================== --- cfe/trunk/include/clang/Tooling/CompilationDatabase.h +++ cfe/trunk/include/clang/Tooling/CompilationDatabase.h @@ -60,16 +60,6 @@ /// 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.
Index: cfe/trunk/tools/libclang/CXCompilationDatabase.cpp =================================================================== --- cfe/trunk/tools/libclang/CXCompilationDatabase.cpp +++ cfe/trunk/tools/libclang/CXCompilationDatabase.cpp @@ -145,36 +145,23 @@ 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(); } Index: cfe/trunk/include/clang/Tooling/CompilationDatabase.h =================================================================== --- cfe/trunk/include/clang/Tooling/CompilationDatabase.h +++ cfe/trunk/include/clang/Tooling/CompilationDatabase.h @@ -60,16 +60,6 @@ /// 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.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits