aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:11 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-08-02 17:33:11 +0000
commitc7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (patch)
tree27425930fc0c91650a7f3527fcac8e0f92907b90 /lib/Parse/ParseTentative.cpp
parent486754660bb926339aefcf012a3f848592babb8b (diff)
downloadsrc-c7e70c433efc6953dc3888b9fbf9f3512d7da2b0.tar.gz
src-c7e70c433efc6953dc3888b9fbf9f3512d7da2b0.zip
Vendor import of clang trunk r338536:vendor/clang/clang-trunk-r338536
Notes
Notes: svn path=/vendor/clang/dist/; revision=337139 svn path=/vendor/clang/clang-trunk-r338536/; revision=337140; tag=vendor/clang/clang-trunk-r338536
Diffstat (limited to 'lib/Parse/ParseTentative.cpp')
-rw-r--r--lib/Parse/ParseTentative.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/Parse/ParseTentative.cpp b/lib/Parse/ParseTentative.cpp
index 0603d8e75eea..dfd1f8c3b2e6 100644
--- a/lib/Parse/ParseTentative.cpp
+++ b/lib/Parse/ParseTentative.cpp
@@ -80,10 +80,10 @@ bool Parser::isCXXDeclarationStatement() {
/// (if AllowForRangeDecl specified)
/// for ( for-range-declaration : for-range-initializer ) statement
///
-/// for-range-declaration:
+/// for-range-declaration:
/// decl-specifier-seq declarator
/// decl-specifier-seq ref-qualifier[opt] '[' identifier-list ']'
-///
+///
/// In any of the above cases there can be a preceding attribute-specifier-seq,
/// but the caller is expected to handle that.
bool Parser::isCXXSimpleDeclaration(bool AllowForRangeDecl) {
@@ -132,7 +132,7 @@ bool Parser::isCXXSimpleDeclaration(bool AllowForRangeDecl) {
// Ok, we have a simple-type-specifier/typename-specifier followed by a '(',
// or an identifier which doesn't resolve as anything. We need tentative
// parsing...
-
+
{
RevertingTentativeParsingAction PA(*this);
TPR = TryParseSimpleDeclaration(AllowForRangeDecl);
@@ -236,7 +236,7 @@ Parser::TPResult Parser::TryConsumeDeclarationSpecifier() {
///
/// (if AllowForRangeDecl specified)
/// for ( for-range-declaration : for-range-initializer ) statement
-/// for-range-declaration:
+/// for-range-declaration:
/// attribute-specifier-seqopt type-specifier-seq declarator
///
Parser::TPResult Parser::TryParseSimpleDeclaration(bool AllowForRangeDecl) {
@@ -964,7 +964,7 @@ Parser::TPResult Parser::TryParseDeclarator(bool mayBeAbstract,
return TPResult::Ambiguous;
}
-Parser::TPResult
+Parser::TPResult
Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
switch (Kind) {
// Obviously starts an expression.
@@ -1026,7 +1026,7 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
case tok::kw_##Spelling:
#include "clang/Basic/TokenKinds.def"
return TPResult::True;
-
+
// Obviously starts a type-specifier-seq:
case tok::kw_char:
case tok::kw_const:
@@ -1084,7 +1084,7 @@ Parser::isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind) {
default:
break;
}
-
+
return TPResult::Ambiguous;
}
@@ -1338,7 +1338,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
// Debugger support
case tok::kw___unknown_anytype:
-
+
// type-specifier:
// simple-type-specifier
// class-specifier
@@ -1395,7 +1395,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
// Borland
case tok::kw___pascal:
return TPResult::True;
-
+
// AltiVec
case tok::kw___vector:
return TPResult::True;
@@ -1510,24 +1510,24 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
// Tentatively parse the protocol qualifiers.
RevertingTentativeParsingAction PA(*this);
ConsumeAnyToken(); // The type token
-
+
TPResult TPR = TryParseProtocolQualifiers();
bool isFollowedByParen = Tok.is(tok::l_paren);
bool isFollowedByBrace = Tok.is(tok::l_brace);
-
+
if (TPR == TPResult::Error)
return TPResult::Error;
-
+
if (isFollowedByParen)
return TPResult::Ambiguous;
if (getLangOpts().CPlusPlus11 && isFollowedByBrace)
return BracedCastResult;
-
+
return TPResult::True;
}
LLVM_FALLTHROUGH;
-
+
case tok::kw_char:
case tok::kw_wchar_t:
case tok::kw_char8_t:
@@ -1562,7 +1562,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
if (isStartOfObjCClassMessageMissingOpenBracket())
return TPResult::False;
-
+
return TPResult::True;
// GNU typeof support.
@@ -1681,18 +1681,18 @@ Parser::TPResult Parser::TryParseProtocolQualifiers() {
if (Tok.isNot(tok::identifier))
return TPResult::Error;
ConsumeToken();
-
+
if (Tok.is(tok::comma)) {
ConsumeToken();
continue;
}
-
+
if (Tok.is(tok::greater)) {
ConsumeToken();
return TPResult::Ambiguous;
}
} while (false);
-
+
return TPResult::Error;
}
@@ -1910,7 +1910,7 @@ Parser::TPResult Parser::TryParseFunctionDeclarator() {
// ref-qualifier[opt]
if (Tok.isOneOf(tok::amp, tok::ampamp))
ConsumeToken();
-
+
// exception-specification
if (Tok.is(tok::kw_throw)) {
ConsumeToken();