diff --git a/plugins/cpp/parser/include/cppparser/filelocutil.h b/plugins/cpp/parser/include/cppparser/filelocutil.h index 221f696c0..04e0734cd 100644 --- a/plugins/cpp/parser/include/cppparser/filelocutil.h +++ b/plugins/cpp/parser/include/cppparser/filelocutil.h @@ -91,7 +91,7 @@ class FileLocUtil if (fid.isInvalid()) return std::string(); - const clang::FileEntry* fileEntry = _clangSrcMan.getFileEntryForID(fid); + const clang::OptionalFileEntryRef fileEntry = _clangSrcMan.getFileEntryRefForID(fid); if (!fileEntry) return std::string(); diff --git a/plugins/cpp/parser/src/cppparser.cpp b/plugins/cpp/parser/src/cppparser.cpp index 58620801c..7e1f4388e 100644 --- a/plugins/cpp/parser/src/cppparser.cpp +++ b/plugins/cpp/parser/src/cppparser.cpp @@ -232,7 +232,7 @@ model::BuildActionPtr CppParser::addBuildAction( model::BuildActionPtr buildAction(new model::BuildAction); - std::string extension = fs::extension(command_.Filename); + std::string extension = fs::path(command_.Filename).extension().string(); buildAction->command = boost::algorithm::join(command_.CommandLine, " "); buildAction->type diff --git a/plugins/cpp/parser/src/doccommentformatter.cpp b/plugins/cpp/parser/src/doccommentformatter.cpp index 1d2439b1d..9d495dbfa 100644 --- a/plugins/cpp/parser/src/doccommentformatter.cpp +++ b/plugins/cpp/parser/src/doccommentformatter.cpp @@ -58,10 +58,10 @@ FullCommentParts::FullCommentParts( switch (child->getCommentKind()) { - case Comment::NoCommentKind: + case CommentKind::None: continue; - case Comment::ParagraphCommentKind: + case CommentKind::ParagraphComment: { const ParagraphComment* pc = llvm::cast(child); @@ -75,7 +75,7 @@ FullCommentParts::FullCommentParts( break; } - case Comment::BlockCommandCommentKind: + case CommentKind::BlockCommandComment: { const BlockCommandComment* bcc = llvm::cast(child); const CommandInfo* Info = traits_.getCommandInfo(bcc->getCommandID()); @@ -94,7 +94,7 @@ FullCommentParts::FullCommentParts( break; } - case Comment::ParamCommandCommentKind: + case CommentKind::ParamCommandComment: { const ParamCommandComment* pcc = llvm::cast(child); @@ -108,7 +108,7 @@ FullCommentParts::FullCommentParts( break; } - case Comment::TParamCommandCommentKind: + case CommentKind::TParamCommandComment: { const TParamCommandComment* tpcc = llvm::cast(child); @@ -123,11 +123,11 @@ FullCommentParts::FullCommentParts( break; } - case Comment::VerbatimBlockCommentKind: + case CommentKind::VerbatimBlockComment: _miscBlocks.push_back(cast(child)); break; - case Comment::VerbatimLineCommentKind: + case CommentKind::VerbatimLineComment: { const VerbatimLineComment* vlc = llvm::cast(child); const CommandInfo* Info = traits_.getCommandInfo(vlc->getCommandID()); @@ -251,22 +251,22 @@ void CommentToMarkdownConverter::visitInlineCommandComment( switch (c_->getRenderKind()) { - case InlineCommandComment::RenderNormal: + case InlineCommandRenderKind::Normal: for (unsigned i = 0, e = c_->getNumArgs(); i != e; ++i) _res << c_->getArgText(i).str() << ' '; return; - case InlineCommandComment::RenderBold: + case InlineCommandRenderKind::Bold: assert(c_->getNumArgs() == 1); _res << "**" << arg0.str() << "**"; return; - case InlineCommandComment::RenderMonospaced: + case InlineCommandRenderKind::Monospaced: assert(c_->getNumArgs() == 1); _res << '`' << arg0.str() << '`'; return; - case InlineCommandComment::RenderEmphasized: + case InlineCommandRenderKind::Emphasized: assert(c_->getNumArgs() == 1); _res << '*' << arg0.str() << '*'; return; @@ -336,9 +336,9 @@ void CommentToMarkdownConverter::visitParamCommandComment( { switch (c_->getDirection()) { - case ParamCommandComment::In: _res << "- *in*: "; break; - case ParamCommandComment::Out: _res << "- *out*: "; break; - case ParamCommandComment::InOut: _res << "- *in,out*: "; break; + case ParamCommandPassDirection::In: _res << "- *in*: "; break; + case ParamCommandPassDirection::Out: _res << "- *out*: "; break; + case ParamCommandPassDirection::InOut: _res << "- *in,out*: "; break; } _res << "**" << (c_->isParamIndexValid() diff --git a/plugins/cpp/parser/src/ppincludecallback.cpp b/plugins/cpp/parser/src/ppincludecallback.cpp index 9c8393560..3aeb2a9ca 100644 --- a/plugins/cpp/parser/src/ppincludecallback.cpp +++ b/plugins/cpp/parser/src/ppincludecallback.cpp @@ -61,10 +61,11 @@ void PPIncludeCallback::InclusionDirective( clang::StringRef fileName_, bool, clang::CharSourceRange filenameRange_, - clang::Optional, + clang::OptionalFileEntryRef, clang::StringRef searchPath_, clang::StringRef, const clang::Module*, + bool, clang::SrcMgr::CharacteristicKind) { if (searchPath_.empty()) diff --git a/plugins/cpp/parser/src/ppincludecallback.h b/plugins/cpp/parser/src/ppincludecallback.h index 6d67367f3..abaf55871 100644 --- a/plugins/cpp/parser/src/ppincludecallback.h +++ b/plugins/cpp/parser/src/ppincludecallback.h @@ -38,10 +38,11 @@ class PPIncludeCallback : public clang::PPCallbacks clang::StringRef FileName, bool IsAngled, clang::CharSourceRange FilenameRange, - clang::Optional File, + clang::OptionalFileEntryRef File, clang::StringRef SearchPath, clang::StringRef RelativePath, const clang::Module *Imported, + bool ModuleImported, clang::SrcMgr::CharacteristicKind FileType) override; private: diff --git a/plugins/dummy/parser/src/dummyparser.cpp b/plugins/dummy/parser/src/dummyparser.cpp index 9c3f2ff1e..1d8fa2346 100644 --- a/plugins/dummy/parser/src/dummyparser.cpp +++ b/plugins/dummy/parser/src/dummyparser.cpp @@ -17,7 +17,7 @@ DummyParser::DummyParser(ParserContext& ctx_): AbstractParser(ctx_) bool DummyParser::accept(const std::string& path_) { - std::string ext = boost::filesystem::extension(path_); + std::string ext = boost::filesystem::path(path_).string(); return ext == ".dummy"; } diff --git a/service/workspace/src/workspaceservice.cpp b/service/workspace/src/workspaceservice.cpp index 1a88caa64..e395efd99 100644 --- a/service/workspace/src/workspaceservice.cpp +++ b/service/workspace/src/workspaceservice.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace cc { diff --git a/util/include/util/hash.h b/util/include/util/hash.h index f7f308ada..60ca2b718 100644 --- a/util/include/util/hash.h +++ b/util/include/util/hash.h @@ -36,18 +36,18 @@ inline std::string sha1Hash(const std::string& data_) using namespace boost::uuids::detail; sha1 hasher; - unsigned int digest[5]; + unsigned char digest[20]; hasher.process_bytes(data_.c_str(), data_.size()); hasher.get_digest(digest); std::stringstream ss; ss.setf(std::ios::hex, std::ios::basefield); - ss.width(8); + ss.width(2); ss.fill('0'); - for (int i = 0; i < 5; ++i) - ss << digest[i]; + for (int i = 0; i < 20; ++i) + ss << (int)digest[i]; return ss.str(); }