summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/Representation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-doc/Representation.cpp')
-rw-r--r--clang-tools-extra/clang-doc/Representation.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang-tools-extra/clang-doc/Representation.cpp b/clang-tools-extra/clang-doc/Representation.cpp
index 18cec16cff2..4b9d9e5b43d 100644
--- a/clang-tools-extra/clang-doc/Representation.cpp
+++ b/clang-tools-extra/clang-doc/Representation.cpp
@@ -257,8 +257,12 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
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 &&
OpenPOWER on IntegriCloud