From b773203fb58f3ef282fb69c832d8710cab5bc82d Mon Sep 17 00:00:00 2001 From: patrick Date: Sun, 27 Jan 2019 16:42:12 +0000 Subject: Import LLVM 7.0.1 release including clang, lld and lldb. --- gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp') diff --git a/gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp b/gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp index 199d2974c5c..c7f720a443d 100644 --- a/gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp +++ b/gnu/llvm/tools/clang/lib/Format/FormatTokenLexer.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// /// /// \file -/// \brief This file implements FormatTokenLexer, which tokenizes a source file +/// This file implements FormatTokenLexer, which tokenizes a source file /// into a FormatToken stream suitable for ClangFormat. /// //===----------------------------------------------------------------------===// @@ -38,7 +38,7 @@ FormatTokenLexer::FormatTokenLexer(const SourceManager &SourceMgr, FileID ID, for (const std::string &ForEachMacro : Style.ForEachMacros) ForEachMacros.push_back(&IdentTable.get(ForEachMacro)); - std::sort(ForEachMacros.begin(), ForEachMacros.end()); + llvm::sort(ForEachMacros.begin(), ForEachMacros.end()); } ArrayRef FormatTokenLexer::lex() { @@ -334,7 +334,7 @@ void FormatTokenLexer::handleTemplateStrings() { void FormatTokenLexer::tryParsePythonComment() { FormatToken *HashToken = Tokens.back(); - if (HashToken->isNot(tok::hash)) + if (!HashToken->isOneOf(tok::hash, tok::hashhash)) return; // Turn the remainder of this line into a comment. const char *CommentBegin = @@ -691,7 +691,9 @@ void FormatTokenLexer::readRawToken(FormatToken &Tok) { } } - if (Style.Language == FormatStyle::LK_JavaScript && + if ((Style.Language == FormatStyle::LK_JavaScript || + Style.Language == FormatStyle::LK_Proto || + Style.Language == FormatStyle::LK_TextProto) && Tok.is(tok::char_constant)) { Tok.Tok.setKind(tok::string_literal); } -- cgit v1.2.3-59-g8ed1b