This revision was automatically updated to reflect the committed changes. Closed by commit rL369065: [clang-doc] Fix use of source-root flag (authored by DiegoAstiazaran, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D66268?vs=215302&id=215497#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66268/new/ https://reviews.llvm.org/D66268 Files: clang-tools-extra/trunk/clang-doc/Representation.cpp clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp Index: clang-tools-extra/trunk/clang-doc/Representation.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/Representation.cpp +++ clang-tools-extra/trunk/clang-doc/Representation.cpp @@ -257,8 +257,12 @@ std::vector<std::string> UserStylesheets, std::vector<std::string> JsScripts) : ECtx(ECtx), PublicOnly(PublicOnly), OutDirectory(OutDirectory), - SourceRoot(SourceRoot), UserStylesheets(UserStylesheets), - JsScripts(JsScripts) { + UserStylesheets(UserStylesheets), JsScripts(JsScripts) { + llvm::SmallString<128> SourceRootDir(SourceRoot); + if (SourceRoot.empty()) + // If no SourceRoot was provided the current path is used as the default + llvm::sys::fs::current_path(SourceRootDir); + this->SourceRoot = SourceRootDir.str(); if (!RepositoryUrl.empty()) { this->RepositoryUrl = RepositoryUrl; if (!RepositoryUrl.empty() && RepositoryUrl.find("http://") != 0 && Index: clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp +++ clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp @@ -203,17 +203,11 @@ tooling::ArgumentInsertPosition::END), ArgAdjuster); - llvm::SmallString<128> SourceRootDir; - // Check if the --source-root flag has a value - if (SourceRoot.empty()) - // If it's empty the current path is used as the default - llvm::sys::fs::current_path(SourceRootDir); - clang::doc::ClangDocContext CDCtx = { Exec->get()->getExecutionContext(), PublicOnly, OutDirectory, - SourceRootDir.str(), + SourceRoot, RepositoryUrl, {UserStylesheets.begin(), UserStylesheets.end()}, {"index.js", "index_json.js"}};
Index: clang-tools-extra/trunk/clang-doc/Representation.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/Representation.cpp +++ clang-tools-extra/trunk/clang-doc/Representation.cpp @@ -257,8 +257,12 @@ std::vector<std::string> UserStylesheets, std::vector<std::string> JsScripts) : ECtx(ECtx), PublicOnly(PublicOnly), OutDirectory(OutDirectory), - SourceRoot(SourceRoot), UserStylesheets(UserStylesheets), - JsScripts(JsScripts) { + UserStylesheets(UserStylesheets), JsScripts(JsScripts) { + llvm::SmallString<128> SourceRootDir(SourceRoot); + if (SourceRoot.empty()) + // If no SourceRoot was provided the current path is used as the default + llvm::sys::fs::current_path(SourceRootDir); + this->SourceRoot = SourceRootDir.str(); if (!RepositoryUrl.empty()) { this->RepositoryUrl = RepositoryUrl; if (!RepositoryUrl.empty() && RepositoryUrl.find("http://") != 0 && Index: clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp =================================================================== --- clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp +++ clang-tools-extra/trunk/clang-doc/tool/ClangDocMain.cpp @@ -203,17 +203,11 @@ tooling::ArgumentInsertPosition::END), ArgAdjuster); - llvm::SmallString<128> SourceRootDir; - // Check if the --source-root flag has a value - if (SourceRoot.empty()) - // If it's empty the current path is used as the default - llvm::sys::fs::current_path(SourceRootDir); - clang::doc::ClangDocContext CDCtx = { Exec->get()->getExecutionContext(), PublicOnly, OutDirectory, - SourceRootDir.str(), + SourceRoot, RepositoryUrl, {UserStylesheets.begin(), UserStylesheets.end()}, {"index.js", "index_json.js"}};
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits