Clang Project

clang_source_code/include/clang/Parse/Parser.h
1//===--- Parser.h - C Language Parser ---------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//  This file defines the Parser interface.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_PARSE_PARSER_H
14#define LLVM_CLANG_PARSE_PARSER_H
15
16#include "clang/AST/OpenMPClause.h"
17#include "clang/AST/Availability.h"
18#include "clang/Basic/BitmaskEnum.h"
19#include "clang/Basic/OpenMPKinds.h"
20#include "clang/Basic/OperatorPrecedence.h"
21#include "clang/Basic/Specifiers.h"
22#include "clang/Lex/CodeCompletionHandler.h"
23#include "clang/Lex/Preprocessor.h"
24#include "clang/Sema/DeclSpec.h"
25#include "clang/Sema/Sema.h"
26#include "llvm/ADT/SmallVector.h"
27#include "llvm/Support/Compiler.h"
28#include "llvm/Support/PrettyStackTrace.h"
29#include "llvm/Support/SaveAndRestore.h"
30#include <memory>
31#include <stack>
32
33namespace clang {
34  class PragmaHandler;
35  class Scope;
36  class BalancedDelimiterTracker;
37  class CorrectionCandidateCallback;
38  class DeclGroupRef;
39  class DiagnosticBuilder;
40  struct LoopHint;
41  class Parser;
42  class ParsingDeclRAIIObject;
43  class ParsingDeclSpec;
44  class ParsingDeclarator;
45  class ParsingFieldDeclarator;
46  class ColonProtectionRAIIObject;
47  class InMessageExpressionRAIIObject;
48  class PoisonSEHIdentifiersRAIIObject;
49  class OMPClause;
50  class ObjCTypeParamList;
51  class ObjCTypeParameter;
52
53/// Parser - This implements a parser for the C family of languages.  After
54/// parsing units of the grammar, productions are invoked to handle whatever has
55/// been read.
56///
57class Parser : public CodeCompletionHandler {
58  friend class ColonProtectionRAIIObject;
59  friend class InMessageExpressionRAIIObject;
60  friend class PoisonSEHIdentifiersRAIIObject;
61  friend class ObjCDeclContextSwitch;
62  friend class ParenBraceBracketBalancer;
63  friend class BalancedDelimiterTracker;
64
65  Preprocessor &PP;
66
67  /// Tok - The current token we are peeking ahead.  All parsing methods assume
68  /// that this is valid.
69  Token Tok;
70
71  // PrevTokLocation - The location of the token we previously
72  // consumed. This token is used for diagnostics where we expected to
73  // see a token following another token (e.g., the ';' at the end of
74  // a statement).
75  SourceLocation PrevTokLocation;
76
77  /// Tracks an expected type for the current token when parsing an expression.
78  /// Used by code completion for ranking.
79  PreferredTypeBuilder PreferredType;
80
81  unsigned short ParenCount = 0BracketCount = 0BraceCount = 0;
82  unsigned short MisplacedModuleBeginCount = 0;
83
84  /// Actions - These are the callbacks we invoke as we parse various constructs
85  /// in the file.
86  Sema &Actions;
87
88  DiagnosticsEngine &Diags;
89
90  /// ScopeCache - Cache scopes to reduce malloc traffic.
91  enum { ScopeCacheSize = 16 };
92  unsigned NumCachedScopes;
93  Scope *ScopeCache[ScopeCacheSize];
94
95  /// Identifiers used for SEH handling in Borland. These are only
96  /// allowed in particular circumstances
97  // __except block
98  IdentifierInfo *Ident__exception_code,
99                 *Ident___exception_code,
100                 *Ident_GetExceptionCode;
101  // __except filter expression
102  IdentifierInfo *Ident__exception_info,
103                 *Ident___exception_info,
104                 *Ident_GetExceptionInfo;
105  // __finally
106  IdentifierInfo *Ident__abnormal_termination,
107                 *Ident___abnormal_termination,
108                 *Ident_AbnormalTermination;
109
110  /// Contextual keywords for Microsoft extensions.
111  IdentifierInfo *Ident__except;
112  mutable IdentifierInfo *Ident_sealed;
113
114  /// Ident_super - IdentifierInfo for "super", to support fast
115  /// comparison.
116  IdentifierInfo *Ident_super;
117  /// Ident_vector, Ident_bool - cached IdentifierInfos for "vector" and
118  /// "bool" fast comparison.  Only present if AltiVec or ZVector are enabled.
119  IdentifierInfo *Ident_vector;
120  IdentifierInfo *Ident_bool;
121  /// Ident_pixel - cached IdentifierInfos for "pixel" fast comparison.
122  /// Only present if AltiVec enabled.
123  IdentifierInfo *Ident_pixel;
124
125  /// Objective-C contextual keywords.
126  IdentifierInfo *Ident_instancetype;
127
128  /// Identifier for "introduced".
129  IdentifierInfo *Ident_introduced;
130
131  /// Identifier for "deprecated".
132  IdentifierInfo *Ident_deprecated;
133
134  /// Identifier for "obsoleted".
135  IdentifierInfo *Ident_obsoleted;
136
137  /// Identifier for "unavailable".
138  IdentifierInfo *Ident_unavailable;
139
140  /// Identifier for "message".
141  IdentifierInfo *Ident_message;
142
143  /// Identifier for "strict".
144  IdentifierInfo *Ident_strict;
145
146  /// Identifier for "replacement".
147  IdentifierInfo *Ident_replacement;
148
149  /// Identifiers used by the 'external_source_symbol' attribute.
150  IdentifierInfo *Ident_language, *Ident_defined_in,
151      *Ident_generated_declaration;
152
153  /// C++0x contextual keywords.
154  mutable IdentifierInfo *Ident_final;
155  mutable IdentifierInfo *Ident_GNU_final;
156  mutable IdentifierInfo *Ident_override;
157
158  // C++ type trait keywords that can be reverted to identifiers and still be
159  // used as type traits.
160  llvm::SmallDenseMap<IdentifierInfo *, tok::TokenKind> RevertibleTypeTraits;
161
162  std::unique_ptr<PragmaHandlerAlignHandler;
163  std::unique_ptr<PragmaHandlerGCCVisibilityHandler;
164  std::unique_ptr<PragmaHandlerOptionsHandler;
165  std::unique_ptr<PragmaHandlerPackHandler;
166  std::unique_ptr<PragmaHandlerMSStructHandler;
167  std::unique_ptr<PragmaHandlerUnusedHandler;
168  std::unique_ptr<PragmaHandlerWeakHandler;
169  std::unique_ptr<PragmaHandlerRedefineExtnameHandler;
170  std::unique_ptr<PragmaHandlerFPContractHandler;
171  std::unique_ptr<PragmaHandlerOpenCLExtensionHandler;
172  std::unique_ptr<PragmaHandlerOpenMPHandler;
173  std::unique_ptr<PragmaHandlerPCSectionHandler;
174  std::unique_ptr<PragmaHandlerMSCommentHandler;
175  std::unique_ptr<PragmaHandlerMSDetectMismatchHandler;
176  std::unique_ptr<PragmaHandlerMSPointersToMembers;
177  std::unique_ptr<PragmaHandlerMSVtorDisp;
178  std::unique_ptr<PragmaHandlerMSInitSeg;
179  std::unique_ptr<PragmaHandlerMSDataSeg;
180  std::unique_ptr<PragmaHandlerMSBSSSeg;
181  std::unique_ptr<PragmaHandlerMSConstSeg;
182  std::unique_ptr<PragmaHandlerMSCodeSeg;
183  std::unique_ptr<PragmaHandlerMSSection;
184  std::unique_ptr<PragmaHandlerMSRuntimeChecks;
185  std::unique_ptr<PragmaHandlerMSIntrinsic;
186  std::unique_ptr<PragmaHandlerMSOptimize;
187  std::unique_ptr<PragmaHandlerCUDAForceHostDeviceHandler;
188  std::unique_ptr<PragmaHandlerOptimizeHandler;
189  std::unique_ptr<PragmaHandlerLoopHintHandler;
190  std::unique_ptr<PragmaHandlerUnrollHintHandler;
191  std::unique_ptr<PragmaHandlerNoUnrollHintHandler;
192  std::unique_ptr<PragmaHandlerUnrollAndJamHintHandler;
193  std::unique_ptr<PragmaHandlerNoUnrollAndJamHintHandler;
194  std::unique_ptr<PragmaHandlerFPHandler;
195  std::unique_ptr<PragmaHandlerSTDCFENVHandler;
196  std::unique_ptr<PragmaHandlerSTDCCXLIMITHandler;
197  std::unique_ptr<PragmaHandlerSTDCUnknownHandler;
198  std::unique_ptr<PragmaHandlerAttributePragmaHandler;
199
200  std::unique_ptr<CommentHandlerCommentSemaHandler;
201
202  /// Whether the '>' token acts as an operator or not. This will be
203  /// true except when we are parsing an expression within a C++
204  /// template argument list, where the '>' closes the template
205  /// argument list.
206  bool GreaterThanIsOperator;
207
208  /// ColonIsSacred - When this is false, we aggressively try to recover from
209  /// code like "foo : bar" as if it were a typo for "foo :: bar".  This is not
210  /// safe in case statements and a few other things.  This is managed by the
211  /// ColonProtectionRAIIObject RAII object.
212  bool ColonIsSacred;
213
214  /// When true, we are directly inside an Objective-C message
215  /// send expression.
216  ///
217  /// This is managed by the \c InMessageExpressionRAIIObject class, and
218  /// should not be set directly.
219  bool InMessageExpression;
220
221  /// Gets set to true after calling ProduceSignatureHelp, it is for a
222  /// workaround to make sure ProduceSignatureHelp is only called at the deepest
223  /// function call.
224  bool CalledSignatureHelp = false;
225
226  /// The "depth" of the template parameters currently being parsed.
227  unsigned TemplateParameterDepth;
228
229  /// RAII class that manages the template parameter depth.
230  class TemplateParameterDepthRAII {
231    unsigned &Depth;
232    unsigned AddedLevels;
233  public:
234    explicit TemplateParameterDepthRAII(unsigned &Depth)
235      : Depth(Depth), AddedLevels(0) {}
236
237    ~TemplateParameterDepthRAII() {
238      Depth -= AddedLevels;
239    }
240
241    void operator++() {
242      ++Depth;
243      ++AddedLevels;
244    }
245    void addDepth(unsigned D) {
246      Depth += D;
247      AddedLevels += D;
248    }
249    unsigned getDepth() const { return Depth; }
250  };
251
252  /// Factory object for creating ParsedAttr objects.
253  AttributeFactory AttrFactory;
254
255  /// Gathers and cleans up TemplateIdAnnotations when parsing of a
256  /// top-level declaration is finished.
257  SmallVector<TemplateIdAnnotation *, 16TemplateIds;
258
259  /// Identifiers which have been declared within a tentative parse.
260  SmallVector<IdentifierInfo *, 8TentativelyDeclaredIdentifiers;
261
262  /// Tracker for '<' tokens that might have been intended to be treated as an
263  /// angle bracket instead of a less-than comparison.
264  ///
265  /// This happens when the user intends to form a template-id, but typoes the
266  /// template-name or forgets a 'template' keyword for a dependent template
267  /// name.
268  ///
269  /// We track these locations from the point where we see a '<' with a
270  /// name-like expression on its left until we see a '>' or '>>' that might
271  /// match it.
272  struct AngleBracketTracker {
273    /// Flags used to rank candidate template names when there is more than one
274    /// '<' in a scope.
275    enum Priority : unsigned short {
276      /// A non-dependent name that is a potential typo for a template name.
277      PotentialTypo = 0x0,
278      /// A dependent name that might instantiate to a template-name.
279      DependentName = 0x2,
280
281      /// A space appears before the '<' token.
282      SpaceBeforeLess = 0x0,
283      /// No space before the '<' token
284      NoSpaceBeforeLess = 0x1,
285
286      LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue*/ DependentName)
287    };
288
289    struct Loc {
290      Expr *TemplateName;
291      SourceLocation LessLoc;
292      AngleBracketTracker::Priority Priority;
293      unsigned short ParenCountBracketCountBraceCount;
294
295      bool isActive(Parser &Pconst {
296        return P.ParenCount == ParenCount && P.BracketCount == BracketCount &&
297               P.BraceCount == BraceCount;
298      }
299
300      bool isActiveOrNested(Parser &Pconst {
301        return isActive(P) || P.ParenCount > ParenCount ||
302               P.BracketCount > BracketCount || P.BraceCount > BraceCount;
303      }
304    };
305
306    SmallVector<Loc8Locs;
307
308    /// Add an expression that might have been intended to be a template name.
309    /// In the case of ambiguity, we arbitrarily select the innermost such
310    /// expression, for example in 'foo < bar < baz', 'bar' is the current
311    /// candidate. No attempt is made to track that 'foo' is also a candidate
312    /// for the case where we see a second suspicious '>' token.
313    void add(Parser &PExpr *TemplateNameSourceLocation LessLoc,
314             Priority Prio) {
315      if (!Locs.empty() && Locs.back().isActive(P)) {
316        if (Locs.back().Priority <= Prio) {
317          Locs.back().TemplateName = TemplateName;
318          Locs.back().LessLoc = LessLoc;
319          Locs.back().Priority = Prio;
320        }
321      } else {
322        Locs.push_back({TemplateName, LessLoc, Prio,
323                        P.ParenCount, P.BracketCount, P.BraceCount});
324      }
325    }
326
327    /// Mark the current potential missing template location as having been
328    /// handled (this happens if we pass a "corresponding" '>' or '>>' token
329    /// or leave a bracket scope).
330    void clear(Parser &P) {
331      while (!Locs.empty() && Locs.back().isActiveOrNested(P))
332        Locs.pop_back();
333    }
334
335    /// Get the current enclosing expression that might hve been intended to be
336    /// a template name.
337    Loc *getCurrent(Parser &P) {
338      if (!Locs.empty() && Locs.back().isActive(P))
339        return &Locs.back();
340      return nullptr;
341    }
342  };
343
344  AngleBracketTracker AngleBrackets;
345
346  IdentifierInfo *getSEHExceptKeyword();
347
348  /// True if we are within an Objective-C container while parsing C-like decls.
349  ///
350  /// This is necessary because Sema thinks we have left the container
351  /// to parse the C-like decls, meaning Actions.getObjCDeclContext() will
352  /// be NULL.
353  bool ParsingInObjCContainer;
354
355  /// Whether to skip parsing of function bodies.
356  ///
357  /// This option can be used, for example, to speed up searches for
358  /// declarations/definitions when indexing.
359  bool SkipFunctionBodies;
360
361  /// The location of the expression statement that is being parsed right now.
362  /// Used to determine if an expression that is being parsed is a statement or
363  /// just a regular sub-expression.
364  SourceLocation ExprStatementTokLoc;
365
366  /// Flags describing a context in which we're parsing a statement.
367  enum class ParsedStmtContext {
368    /// This context permits declarations in language modes where declarations
369    /// are not statements.
370    AllowDeclarationsInC = 0x1,
371    /// This context permits standalone OpenMP directives.
372    AllowStandaloneOpenMPDirectives = 0x2,
373    /// This context is at the top level of a GNU statement expression.
374    InStmtExpr = 0x4,
375
376    /// The context of a regular substatement.
377    SubStmt = 0,
378    /// The context of a compound-statement.
379    Compound = AllowDeclarationsInC | AllowStandaloneOpenMPDirectives,
380
381    LLVM_MARK_AS_BITMASK_ENUM(InStmtExpr)
382  };
383
384  /// Act on an expression statement that might be the last statement in a
385  /// GNU statement expression. Checks whether we are actually at the end of
386  /// a statement expression and builds a suitable expression statement.
387  StmtResult handleExprStmt(ExprResult EParsedStmtContext StmtCtx);
388
389public:
390  Parser(Preprocessor &PPSema &Actionsbool SkipFunctionBodies);
391  ~Parser() override;
392
393  const LangOptions &getLangOpts() const { return PP.getLangOpts(); }
394  const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
395  Preprocessor &getPreprocessor() const { return PP; }
396  Sema &getActions() const { return Actions; }
397  AttributeFactory &getAttrFactory() { return AttrFactory; }
398
399  const Token &getCurToken() const { return Tok; }
400  Scope *getCurScope() const { return Actions.getCurScope(); }
401  void incrementMSManglingNumber() const {
402    return Actions.incrementMSManglingNumber();
403  }
404
405  Decl  *getObjCDeclContext() const { return Actions.getObjCDeclContext(); }
406
407  // Type forwarding.  All of these are statically 'void*', but they may all be
408  // different actual classes based on the actions in place.
409  typedef OpaquePtr<DeclGroupRefDeclGroupPtrTy;
410  typedef OpaquePtr<TemplateNameTemplateTy;
411
412  typedef SmallVector<TemplateParameterList *, 4TemplateParameterLists;
413
414  typedef Sema::FullExprArg FullExprArg;
415
416  // Parsing methods.
417
418  /// Initialize - Warm up the parser.
419  ///
420  void Initialize();
421
422  /// Parse the first top-level declaration in a translation unit.
423  bool ParseFirstTopLevelDecl(DeclGroupPtrTy &Result);
424
425  /// ParseTopLevelDecl - Parse one top-level declaration. Returns true if
426  /// the EOF was encountered.
427  bool ParseTopLevelDecl(DeclGroupPtrTy &Result);
428  bool ParseTopLevelDecl() {
429    DeclGroupPtrTy Result;
430    return ParseTopLevelDecl(Result);
431  }
432
433  /// ConsumeToken - Consume the current 'peek token' and lex the next one.
434  /// This does not work with special tokens: string literals, code completion,
435  /// annotation tokens and balanced tokens must be handled using the specific
436  /// consume methods.
437  /// Returns the location of the consumed token.
438  SourceLocation ConsumeToken() {
439     (0) . __assert_fail ("!isTokenSpecial() && \"Should consume special tokens with Consume*Token\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 440, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTokenSpecial() &&
440 (0) . __assert_fail ("!isTokenSpecial() && \"Should consume special tokens with Consume*Token\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 440, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Should consume special tokens with Consume*Token");
441    PrevTokLocation = Tok.getLocation();
442    PP.Lex(Tok);
443    return PrevTokLocation;
444  }
445
446  bool TryConsumeToken(tok::TokenKind Expected) {
447    if (Tok.isNot(Expected))
448      return false;
449     (0) . __assert_fail ("!isTokenSpecial() && \"Should consume special tokens with Consume*Token\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 450, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isTokenSpecial() &&
450 (0) . __assert_fail ("!isTokenSpecial() && \"Should consume special tokens with Consume*Token\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 450, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Should consume special tokens with Consume*Token");
451    PrevTokLocation = Tok.getLocation();
452    PP.Lex(Tok);
453    return true;
454  }
455
456  bool TryConsumeToken(tok::TokenKind ExpectedSourceLocation &Loc) {
457    if (!TryConsumeToken(Expected))
458      return false;
459    Loc = PrevTokLocation;
460    return true;
461  }
462
463  /// ConsumeAnyToken - Dispatch to the right Consume* method based on the
464  /// current token type.  This should only be used in cases where the type of
465  /// the token really isn't known, e.g. in error recovery.
466  SourceLocation ConsumeAnyToken(bool ConsumeCodeCompletionTok = false) {
467    if (isTokenParen())
468      return ConsumeParen();
469    if (isTokenBracket())
470      return ConsumeBracket();
471    if (isTokenBrace())
472      return ConsumeBrace();
473    if (isTokenStringLiteral())
474      return ConsumeStringToken();
475    if (Tok.is(tok::code_completion))
476      return ConsumeCodeCompletionTok ? ConsumeCodeCompletionToken()
477                                      : handleUnexpectedCodeCompletionToken();
478    if (Tok.isAnnotation())
479      return ConsumeAnnotationToken();
480    return ConsumeToken();
481  }
482
483
484  SourceLocation getEndOfPreviousToken() {
485    return PP.getLocForEndOfToken(PrevTokLocation);
486  }
487
488  /// Retrieve the underscored keyword (_Nonnull, _Nullable) that corresponds
489  /// to the given nullability kind.
490  IdentifierInfo *getNullabilityKeyword(NullabilityKind nullability) {
491    return Actions.getNullabilityKeyword(nullability);
492  }
493
494private:
495  //===--------------------------------------------------------------------===//
496  // Low-Level token peeking and consumption methods.
497  //
498
499  /// isTokenParen - Return true if the cur token is '(' or ')'.
500  bool isTokenParen() const {
501    return Tok.isOneOf(tok::l_parentok::r_paren);
502  }
503  /// isTokenBracket - Return true if the cur token is '[' or ']'.
504  bool isTokenBracket() const {
505    return Tok.isOneOf(tok::l_squaretok::r_square);
506  }
507  /// isTokenBrace - Return true if the cur token is '{' or '}'.
508  bool isTokenBrace() const {
509    return Tok.isOneOf(tok::l_bracetok::r_brace);
510  }
511  /// isTokenStringLiteral - True if this token is a string-literal.
512  bool isTokenStringLiteral() const {
513    return tok::isStringLiteral(Tok.getKind());
514  }
515  /// isTokenSpecial - True if this token requires special consumption methods.
516  bool isTokenSpecial() const {
517    return isTokenStringLiteral() || isTokenParen() || isTokenBracket() ||
518           isTokenBrace() || Tok.is(tok::code_completion) || Tok.isAnnotation();
519  }
520
521  /// Returns true if the current token is '=' or is a type of '='.
522  /// For typos, give a fixit to '='
523  bool isTokenEqualOrEqualTypo();
524
525  /// Return the current token to the token stream and make the given
526  /// token the current token.
527  void UnconsumeToken(Token &Consumed) {
528      Token Next = Tok;
529      PP.EnterToken(Consumed);
530      PP.Lex(Tok);
531      PP.EnterToken(Next);
532  }
533
534  SourceLocation ConsumeAnnotationToken() {
535     (0) . __assert_fail ("Tok.isAnnotation() && \"wrong consume method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 535, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Tok.isAnnotation() && "wrong consume method");
536    SourceLocation Loc = Tok.getLocation();
537    PrevTokLocation = Tok.getAnnotationEndLoc();
538    PP.Lex(Tok);
539    return Loc;
540  }
541
542  /// ConsumeParen - This consume method keeps the paren count up-to-date.
543  ///
544  SourceLocation ConsumeParen() {
545     (0) . __assert_fail ("isTokenParen() && \"wrong consume method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 545, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTokenParen() && "wrong consume method");
546    if (Tok.getKind() == tok::l_paren)
547      ++ParenCount;
548    else if (ParenCount) {
549      AngleBrackets.clear(*this);
550      --ParenCount;       // Don't let unbalanced )'s drive the count negative.
551    }
552    PrevTokLocation = Tok.getLocation();
553    PP.Lex(Tok);
554    return PrevTokLocation;
555  }
556
557  /// ConsumeBracket - This consume method keeps the bracket count up-to-date.
558  ///
559  SourceLocation ConsumeBracket() {
560     (0) . __assert_fail ("isTokenBracket() && \"wrong consume method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 560, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTokenBracket() && "wrong consume method");
561    if (Tok.getKind() == tok::l_square)
562      ++BracketCount;
563    else if (BracketCount) {
564      AngleBrackets.clear(*this);
565      --BracketCount;     // Don't let unbalanced ]'s drive the count negative.
566    }
567
568    PrevTokLocation = Tok.getLocation();
569    PP.Lex(Tok);
570    return PrevTokLocation;
571  }
572
573  /// ConsumeBrace - This consume method keeps the brace count up-to-date.
574  ///
575  SourceLocation ConsumeBrace() {
576     (0) . __assert_fail ("isTokenBrace() && \"wrong consume method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 576, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTokenBrace() && "wrong consume method");
577    if (Tok.getKind() == tok::l_brace)
578      ++BraceCount;
579    else if (BraceCount) {
580      AngleBrackets.clear(*this);
581      --BraceCount;     // Don't let unbalanced }'s drive the count negative.
582    }
583
584    PrevTokLocation = Tok.getLocation();
585    PP.Lex(Tok);
586    return PrevTokLocation;
587  }
588
589  /// ConsumeStringToken - Consume the current 'peek token', lexing a new one
590  /// and returning the token kind.  This method is specific to strings, as it
591  /// handles string literal concatenation, as per C99 5.1.1.2, translation
592  /// phase #6.
593  SourceLocation ConsumeStringToken() {
594     (0) . __assert_fail ("isTokenStringLiteral() && \"Should only consume string literals with this method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 595, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTokenStringLiteral() &&
595 (0) . __assert_fail ("isTokenStringLiteral() && \"Should only consume string literals with this method\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 595, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Should only consume string literals with this method");
596    PrevTokLocation = Tok.getLocation();
597    PP.Lex(Tok);
598    return PrevTokLocation;
599  }
600
601  /// Consume the current code-completion token.
602  ///
603  /// This routine can be called to consume the code-completion token and
604  /// continue processing in special cases where \c cutOffParsing() isn't
605  /// desired, such as token caching or completion with lookahead.
606  SourceLocation ConsumeCodeCompletionToken() {
607    assert(Tok.is(tok::code_completion));
608    PrevTokLocation = Tok.getLocation();
609    PP.Lex(Tok);
610    return PrevTokLocation;
611  }
612
613  ///\ brief When we are consuming a code-completion token without having
614  /// matched specific position in the grammar, provide code-completion results
615  /// based on context.
616  ///
617  /// \returns the source location of the code-completion token.
618  SourceLocation handleUnexpectedCodeCompletionToken();
619
620  /// Abruptly cut off parsing; mainly used when we have reached the
621  /// code-completion point.
622  void cutOffParsing() {
623    if (PP.isCodeCompletionEnabled())
624      PP.setCodeCompletionReached();
625    // Cut off parsing by acting as if we reached the end-of-file.
626    Tok.setKind(tok::eof);
627  }
628
629  /// Determine if we're at the end of the file or at a transition
630  /// between modules.
631  bool isEofOrEom() {
632    tok::TokenKind Kind = Tok.getKind();
633    return Kind == tok::eof || Kind == tok::annot_module_begin ||
634           Kind == tok::annot_module_end || Kind == tok::annot_module_include;
635  }
636
637  /// Checks if the \p Level is valid for use in a fold expression.
638  bool isFoldOperator(prec::Level Levelconst;
639
640  /// Checks if the \p Kind is a valid operator for fold expressions.
641  bool isFoldOperator(tok::TokenKind Kindconst;
642
643  /// Initialize all pragma handlers.
644  void initializePragmaHandlers();
645
646  /// Destroy and reset all pragma handlers.
647  void resetPragmaHandlers();
648
649  /// Handle the annotation token produced for #pragma unused(...)
650  void HandlePragmaUnused();
651
652  /// Handle the annotation token produced for
653  /// #pragma GCC visibility...
654  void HandlePragmaVisibility();
655
656  /// Handle the annotation token produced for
657  /// #pragma pack...
658  void HandlePragmaPack();
659
660  /// Handle the annotation token produced for
661  /// #pragma ms_struct...
662  void HandlePragmaMSStruct();
663
664  /// Handle the annotation token produced for
665  /// #pragma comment...
666  void HandlePragmaMSComment();
667
668  void HandlePragmaMSPointersToMembers();
669
670  void HandlePragmaMSVtorDisp();
671
672  void HandlePragmaMSPragma();
673  bool HandlePragmaMSSection(StringRef PragmaName,
674                             SourceLocation PragmaLocation);
675  bool HandlePragmaMSSegment(StringRef PragmaName,
676                             SourceLocation PragmaLocation);
677  bool HandlePragmaMSInitSeg(StringRef PragmaName,
678                             SourceLocation PragmaLocation);
679
680  /// Handle the annotation token produced for
681  /// #pragma align...
682  void HandlePragmaAlign();
683
684  /// Handle the annotation token produced for
685  /// #pragma clang __debug dump...
686  void HandlePragmaDump();
687
688  /// Handle the annotation token produced for
689  /// #pragma weak id...
690  void HandlePragmaWeak();
691
692  /// Handle the annotation token produced for
693  /// #pragma weak id = id...
694  void HandlePragmaWeakAlias();
695
696  /// Handle the annotation token produced for
697  /// #pragma redefine_extname...
698  void HandlePragmaRedefineExtname();
699
700  /// Handle the annotation token produced for
701  /// #pragma STDC FP_CONTRACT...
702  void HandlePragmaFPContract();
703
704  /// Handle the annotation token produced for
705  /// #pragma STDC FENV_ACCESS...
706  void HandlePragmaFEnvAccess();
707
708  /// \brief Handle the annotation token produced for
709  /// #pragma clang fp ...
710  void HandlePragmaFP();
711
712  /// Handle the annotation token produced for
713  /// #pragma OPENCL EXTENSION...
714  void HandlePragmaOpenCLExtension();
715
716  /// Handle the annotation token produced for
717  /// #pragma clang __debug captured
718  StmtResult HandlePragmaCaptured();
719
720  /// Handle the annotation token produced for
721  /// #pragma clang loop and #pragma unroll.
722  bool HandlePragmaLoopHint(LoopHint &Hint);
723
724  bool ParsePragmaAttributeSubjectMatchRuleSet(
725      attr::ParsedSubjectMatchRuleSet &SubjectMatchRules,
726      SourceLocation &AnyLocSourceLocation &LastMatchRuleEndLoc);
727
728  void HandlePragmaAttribute();
729
730  /// GetLookAheadToken - This peeks ahead N tokens and returns that token
731  /// without consuming any tokens.  LookAhead(0) returns 'Tok', LookAhead(1)
732  /// returns the token after Tok, etc.
733  ///
734  /// Note that this differs from the Preprocessor's LookAhead method, because
735  /// the Parser always has one token lexed that the preprocessor doesn't.
736  ///
737  const Token &GetLookAheadToken(unsigned N) {
738    if (N == 0 || Tok.is(tok::eof)) return Tok;
739    return PP.LookAhead(N-1);
740  }
741
742public:
743  /// NextToken - This peeks ahead one token and returns it without
744  /// consuming it.
745  const Token &NextToken() {
746    return PP.LookAhead(0);
747  }
748
749  /// getTypeAnnotation - Read a parsed type out of an annotation token.
750  static ParsedType getTypeAnnotation(const Token &Tok) {
751    return ParsedType::getFromOpaquePtr(Tok.getAnnotationValue());
752  }
753
754private:
755  static void setTypeAnnotation(Token &TokParsedType T) {
756    Tok.setAnnotationValue(T.getAsOpaquePtr());
757  }
758
759  /// Read an already-translated primary expression out of an annotation
760  /// token.
761  static ExprResult getExprAnnotation(const Token &Tok) {
762    return ExprResult::getFromOpaquePointer(Tok.getAnnotationValue());
763  }
764
765  /// Set the primary expression corresponding to the given annotation
766  /// token.
767  static void setExprAnnotation(Token &TokExprResult ER) {
768    Tok.setAnnotationValue(ER.getAsOpaquePointer());
769  }
770
771public:
772  // If NeedType is true, then TryAnnotateTypeOrScopeToken will try harder to
773  // find a type name by attempting typo correction.
774  bool TryAnnotateTypeOrScopeToken();
775  bool TryAnnotateTypeOrScopeTokenAfterScopeSpec(CXXScopeSpec &SS,
776                                                 bool IsNewScope);
777  bool TryAnnotateCXXScopeToken(bool EnteringContext = false);
778
779private:
780  enum AnnotatedNameKind {
781    /// Annotation has failed and emitted an error.
782    ANK_Error,
783    /// The identifier is a tentatively-declared name.
784    ANK_TentativeDecl,
785    /// The identifier is a template name. FIXME: Add an annotation for that.
786    ANK_TemplateName,
787    /// The identifier can't be resolved.
788    ANK_Unresolved,
789    /// Annotation was successful.
790    ANK_Success
791  };
792  AnnotatedNameKind TryAnnotateName(bool IsAddressOfOperand,
793                                    CorrectionCandidateCallback *CCC = nullptr);
794
795  /// Push a tok::annot_cxxscope token onto the token stream.
796  void AnnotateScopeToken(CXXScopeSpec &SSbool IsNewAnnotation);
797
798  /// TryAltiVecToken - Check for context-sensitive AltiVec identifier tokens,
799  /// replacing them with the non-context-sensitive keywords.  This returns
800  /// true if the token was replaced.
801  bool TryAltiVecToken(DeclSpec &DSSourceLocation Loc,
802                       const char *&PrevSpecunsigned &DiagID,
803                       bool &isInvalid) {
804    if (!getLangOpts().AltiVec && !getLangOpts().ZVector)
805      return false;
806
807    if (Tok.getIdentifierInfo() != Ident_vector &&
808        Tok.getIdentifierInfo() != Ident_bool &&
809        (!getLangOpts().AltiVec || Tok.getIdentifierInfo() != Ident_pixel))
810      return false;
811
812    return TryAltiVecTokenOutOfLine(DSLocPrevSpecDiagIDisInvalid);
813  }
814
815  /// TryAltiVecVectorToken - Check for context-sensitive AltiVec vector
816  /// identifier token, replacing it with the non-context-sensitive __vector.
817  /// This returns true if the token was replaced.
818  bool TryAltiVecVectorToken() {
819    if ((!getLangOpts().AltiVec && !getLangOpts().ZVector) ||
820        Tok.getIdentifierInfo() != Ident_vectorreturn false;
821    return TryAltiVecVectorTokenOutOfLine();
822  }
823
824  bool TryAltiVecVectorTokenOutOfLine();
825  bool TryAltiVecTokenOutOfLine(DeclSpec &DSSourceLocation Loc,
826                                const char *&PrevSpecunsigned &DiagID,
827                                bool &isInvalid);
828
829  /// Returns true if the current token is the identifier 'instancetype'.
830  ///
831  /// Should only be used in Objective-C language modes.
832  bool isObjCInstancetype() {
833    assert(getLangOpts().ObjC);
834    if (Tok.isAnnotation())
835      return false;
836    if (!Ident_instancetype)
837      Ident_instancetype = PP.getIdentifierInfo("instancetype");
838    return Tok.getIdentifierInfo() == Ident_instancetype;
839  }
840
841  /// TryKeywordIdentFallback - For compatibility with system headers using
842  /// keywords as identifiers, attempt to convert the current token to an
843  /// identifier and optionally disable the keyword for the remainder of the
844  /// translation unit. This returns false if the token was not replaced,
845  /// otherwise emits a diagnostic and returns true.
846  bool TryKeywordIdentFallback(bool DisableKeyword);
847
848  /// Get the TemplateIdAnnotation from the token.
849  TemplateIdAnnotation *takeTemplateIdAnnotation(const Token &tok);
850
851  /// TentativeParsingAction - An object that is used as a kind of "tentative
852  /// parsing transaction". It gets instantiated to mark the token position and
853  /// after the token consumption is done, Commit() or Revert() is called to
854  /// either "commit the consumed tokens" or revert to the previously marked
855  /// token position. Example:
856  ///
857  ///   TentativeParsingAction TPA(*this);
858  ///   ConsumeToken();
859  ///   ....
860  ///   TPA.Revert();
861  ///
862  class TentativeParsingAction {
863    Parser &P;
864    PreferredTypeBuilder PrevPreferredType;
865    Token PrevTok;
866    size_t PrevTentativelyDeclaredIdentifierCount;
867    unsigned short PrevParenCountPrevBracketCountPrevBraceCount;
868    bool isActive;
869
870  public:
871    explicit TentativeParsingAction(Parserp) : P(p) {
872      PrevPreferredType = P.PreferredType;
873      PrevTok = P.Tok;
874      PrevTentativelyDeclaredIdentifierCount =
875          P.TentativelyDeclaredIdentifiers.size();
876      PrevParenCount = P.ParenCount;
877      PrevBracketCount = P.BracketCount;
878      PrevBraceCount = P.BraceCount;
879      P.PP.EnableBacktrackAtThisPos();
880      isActive = true;
881    }
882    void Commit() {
883       (0) . __assert_fail ("isActive && \"Parsing action was finished!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 883, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isActive && "Parsing action was finished!");
884      P.TentativelyDeclaredIdentifiers.resize(
885          PrevTentativelyDeclaredIdentifierCount);
886      P.PP.CommitBacktrackedTokens();
887      isActive = false;
888    }
889    void Revert() {
890       (0) . __assert_fail ("isActive && \"Parsing action was finished!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 890, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isActive && "Parsing action was finished!");
891      P.PP.Backtrack();
892      P.PreferredType = PrevPreferredType;
893      P.Tok = PrevTok;
894      P.TentativelyDeclaredIdentifiers.resize(
895          PrevTentativelyDeclaredIdentifierCount);
896      P.ParenCount = PrevParenCount;
897      P.BracketCount = PrevBracketCount;
898      P.BraceCount = PrevBraceCount;
899      isActive = false;
900    }
901    ~TentativeParsingAction() {
902       (0) . __assert_fail ("!isActive && \"Forgot to call Commit or Revert!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 902, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isActive && "Forgot to call Commit or Revert!");
903    }
904  };
905  /// A TentativeParsingAction that automatically reverts in its destructor.
906  /// Useful for disambiguation parses that will always be reverted.
907  class RevertingTentativeParsingAction
908      : private Parser::TentativeParsingAction {
909  public:
910    RevertingTentativeParsingAction(Parser &P)
911        : Parser::TentativeParsingAction(P) {}
912    ~RevertingTentativeParsingAction() { Revert(); }
913  };
914
915  class UnannotatedTentativeParsingAction;
916
917  /// ObjCDeclContextSwitch - An object used to switch context from
918  /// an objective-c decl context to its enclosing decl context and
919  /// back.
920  class ObjCDeclContextSwitch {
921    Parser &P;
922    Decl *DC;
923    SaveAndRestore<boolWithinObjCContainer;
924  public:
925    explicit ObjCDeclContextSwitch(Parser &p)
926      : P(p), DC(p.getObjCDeclContext()),
927        WithinObjCContainer(P.ParsingInObjCContainer, DC != nullptr) {
928      if (DC)
929        P.Actions.ActOnObjCTemporaryExitContainerContext(cast<DeclContext>(DC));
930    }
931    ~ObjCDeclContextSwitch() {
932      if (DC)
933        P.Actions.ActOnObjCReenterContainerContext(cast<DeclContext>(DC));
934    }
935  };
936
937  /// ExpectAndConsume - The parser expects that 'ExpectedTok' is next in the
938  /// input.  If so, it is consumed and false is returned.
939  ///
940  /// If a trivial punctuator misspelling is encountered, a FixIt error
941  /// diagnostic is issued and false is returned after recovery.
942  ///
943  /// If the input is malformed, this emits the specified diagnostic and true is
944  /// returned.
945  bool ExpectAndConsume(tok::TokenKind ExpectedTok,
946                        unsigned Diag = diag::err_expected,
947                        StringRef DiagMsg = "");
948
949  /// The parser expects a semicolon and, if present, will consume it.
950  ///
951  /// If the next token is not a semicolon, this emits the specified diagnostic,
952  /// or, if there's just some closing-delimiter noise (e.g., ')' or ']') prior
953  /// to the semicolon, consumes that extra token.
954  bool ExpectAndConsumeSemi(unsigned DiagID);
955
956  /// The kind of extra semi diagnostic to emit.
957  enum ExtraSemiKind {
958    OutsideFunction = 0,
959    InsideStruct = 1,
960    InstanceVariableList = 2,
961    AfterMemberFunctionDefinition = 3
962  };
963
964  /// Consume any extra semi-colons until the end of the line.
965  void ConsumeExtraSemi(ExtraSemiKind Kindunsigned TST = TST_unspecified);
966
967  /// Return false if the next token is an identifier. An 'expected identifier'
968  /// error is emitted otherwise.
969  ///
970  /// The parser tries to recover from the error by checking if the next token
971  /// is a C++ keyword when parsing Objective-C++. Return false if the recovery
972  /// was successful.
973  bool expectIdentifier();
974
975public:
976  //===--------------------------------------------------------------------===//
977  // Scope manipulation
978
979  /// ParseScope - Introduces a new scope for parsing. The kind of
980  /// scope is determined by ScopeFlags. Objects of this type should
981  /// be created on the stack to coincide with the position where the
982  /// parser enters the new scope, and this object's constructor will
983  /// create that new scope. Similarly, once the object is destroyed
984  /// the parser will exit the scope.
985  class ParseScope {
986    Parser *Self;
987    ParseScope(const ParseScope &) = delete;
988    void operator=(const ParseScope &) = delete;
989
990  public:
991    // ParseScope - Construct a new object to manage a scope in the
992    // parser Self where the new Scope is created with the flags
993    // ScopeFlags, but only when we aren't about to enter a compound statement.
994    ParseScope(Parser *Selfunsigned ScopeFlagsbool EnteredScope = true,
995               bool BeforeCompoundStmt = false)
996      : Self(Self) {
997      if (EnteredScope && !BeforeCompoundStmt)
998        Self->EnterScope(ScopeFlags);
999      else {
1000        if (BeforeCompoundStmt)
1001          Self->incrementMSManglingNumber();
1002
1003        this->Self = nullptr;
1004      }
1005    }
1006
1007    // Exit - Exit the scope associated with this object now, rather
1008    // than waiting until the object is destroyed.
1009    void Exit() {
1010      if (Self) {
1011        Self->ExitScope();
1012        Self = nullptr;
1013      }
1014    }
1015
1016    ~ParseScope() {
1017      Exit();
1018    }
1019  };
1020
1021  /// EnterScope - Start a new scope.
1022  void EnterScope(unsigned ScopeFlags);
1023
1024  /// ExitScope - Pop a scope off the scope stack.
1025  void ExitScope();
1026
1027private:
1028  /// RAII object used to modify the scope flags for the current scope.
1029  class ParseScopeFlags {
1030    Scope *CurScope;
1031    unsigned OldFlags;
1032    ParseScopeFlags(const ParseScopeFlags &) = delete;
1033    void operator=(const ParseScopeFlags &) = delete;
1034
1035  public:
1036    ParseScopeFlags(Parser *Selfunsigned ScopeFlagsbool ManageFlags = true);
1037    ~ParseScopeFlags();
1038  };
1039
1040  //===--------------------------------------------------------------------===//
1041  // Diagnostic Emission and Error recovery.
1042
1043public:
1044  DiagnosticBuilder Diag(SourceLocation Locunsigned DiagID);
1045  DiagnosticBuilder Diag(const Token &Tokunsigned DiagID);
1046  DiagnosticBuilder Diag(unsigned DiagID) {
1047    return Diag(TokDiagID);
1048  }
1049
1050private:
1051  void SuggestParentheses(SourceLocation Locunsigned DK,
1052                          SourceRange ParenRange);
1053  void CheckNestedObjCContexts(SourceLocation AtLoc);
1054
1055public:
1056
1057  /// Control flags for SkipUntil functions.
1058  enum SkipUntilFlags {
1059    StopAtSemi = 1 << 0,  ///< Stop skipping at semicolon
1060    /// Stop skipping at specified token, but don't skip the token itself
1061    StopBeforeMatch = 1 << 1,
1062    StopAtCodeCompletion = 1 << 2 ///< Stop at code completion
1063  };
1064
1065  friend constexpr SkipUntilFlags operator|(SkipUntilFlags L,
1066                                            SkipUntilFlags R) {
1067    return static_cast<SkipUntilFlags>(static_cast<unsigned>(L) |
1068                                       static_cast<unsigned>(R));
1069  }
1070
1071  /// SkipUntil - Read tokens until we get to the specified token, then consume
1072  /// it (unless StopBeforeMatch is specified).  Because we cannot guarantee
1073  /// that the token will ever occur, this skips to the next token, or to some
1074  /// likely good stopping point.  If Flags has StopAtSemi flag, skipping will
1075  /// stop at a ';' character.
1076  ///
1077  /// If SkipUntil finds the specified token, it returns true, otherwise it
1078  /// returns false.
1079  bool SkipUntil(tok::TokenKind T,
1080                 SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0)) {
1081    return SkipUntil(llvm::makeArrayRef(T), Flags);
1082  }
1083  bool SkipUntil(tok::TokenKind T1tok::TokenKind T2,
1084                 SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0)) {
1085    tok::TokenKind TokArray[] = {T1T2};
1086    return SkipUntil(TokArrayFlags);
1087  }
1088  bool SkipUntil(tok::TokenKind T1tok::TokenKind T2tok::TokenKind T3,
1089                 SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0)) {
1090    tok::TokenKind TokArray[] = {T1T2T3};
1091    return SkipUntil(TokArrayFlags);
1092  }
1093  bool SkipUntil(ArrayRef<tok::TokenKindToks,
1094                 SkipUntilFlags Flags = static_cast<SkipUntilFlags>(0));
1095
1096  /// SkipMalformedDecl - Read tokens until we get to some likely good stopping
1097  /// point for skipping past a simple-declaration.
1098  void SkipMalformedDecl();
1099
1100private:
1101  //===--------------------------------------------------------------------===//
1102  // Lexing and parsing of C++ inline methods.
1103
1104  struct ParsingClass;
1105
1106  /// [class.mem]p1: "... the class is regarded as complete within
1107  /// - function bodies
1108  /// - default arguments
1109  /// - exception-specifications (TODO: C++0x)
1110  /// - and brace-or-equal-initializers for non-static data members
1111  /// (including such things in nested classes)."
1112  /// LateParsedDeclarations build the tree of those elements so they can
1113  /// be parsed after parsing the top-level class.
1114  class LateParsedDeclaration {
1115  public:
1116    virtual ~LateParsedDeclaration();
1117
1118    virtual void ParseLexedMethodDeclarations();
1119    virtual void ParseLexedMemberInitializers();
1120    virtual void ParseLexedMethodDefs();
1121    virtual void ParseLexedAttributes();
1122  };
1123
1124  /// Inner node of the LateParsedDeclaration tree that parses
1125  /// all its members recursively.
1126  class LateParsedClass : public LateParsedDeclaration {
1127  public:
1128    LateParsedClass(Parser *PParsingClass *C);
1129    ~LateParsedClass() override;
1130
1131    void ParseLexedMethodDeclarations() override;
1132    void ParseLexedMemberInitializers() override;
1133    void ParseLexedMethodDefs() override;
1134    void ParseLexedAttributes() override;
1135
1136  private:
1137    Parser *Self;
1138    ParsingClass *Class;
1139  };
1140
1141  /// Contains the lexed tokens of an attribute with arguments that
1142  /// may reference member variables and so need to be parsed at the
1143  /// end of the class declaration after parsing all other member
1144  /// member declarations.
1145  /// FIXME: Perhaps we should change the name of LateParsedDeclaration to
1146  /// LateParsedTokens.
1147  struct LateParsedAttribute : public LateParsedDeclaration {
1148    Parser *Self;
1149    CachedTokens Toks;
1150    IdentifierInfo &AttrName;
1151    SourceLocation AttrNameLoc;
1152    SmallVector<Decl*, 2Decls;
1153
1154    explicit LateParsedAttribute(Parser *PIdentifierInfo &Name,
1155                                 SourceLocation Loc)
1156      : Self(P), AttrName(Name), AttrNameLoc(Loc) {}
1157
1158    void ParseLexedAttributes() override;
1159
1160    void addDecl(Decl *D) { Decls.push_back(D); }
1161  };
1162
1163  // A list of late-parsed attributes.  Used by ParseGNUAttributes.
1164  class LateParsedAttrListpublic SmallVector<LateParsedAttribute *, 2> {
1165  public:
1166    LateParsedAttrList(bool PSoon = false) : ParseSoon(PSoon) { }
1167
1168    bool parseSoon() { return ParseSoon; }
1169
1170  private:
1171    bool ParseSoon;  // Are we planning to parse these shortly after creation?
1172  };
1173
1174  /// Contains the lexed tokens of a member function definition
1175  /// which needs to be parsed at the end of the class declaration
1176  /// after parsing all other member declarations.
1177  struct LexedMethod : public LateParsedDeclaration {
1178    Parser *Self;
1179    Decl *D;
1180    CachedTokens Toks;
1181
1182    /// Whether this member function had an associated template
1183    /// scope. When true, D is a template declaration.
1184    /// otherwise, it is a member function declaration.
1185    bool TemplateScope;
1186
1187    explicit LexedMethod(ParserPDecl *MD)
1188      : Self(P), D(MD), TemplateScope(false) {}
1189
1190    void ParseLexedMethodDefs() override;
1191  };
1192
1193  /// LateParsedDefaultArgument - Keeps track of a parameter that may
1194  /// have a default argument that cannot be parsed yet because it
1195  /// occurs within a member function declaration inside the class
1196  /// (C++ [class.mem]p2).
1197  struct LateParsedDefaultArgument {
1198    explicit LateParsedDefaultArgument(Decl *P,
1199                                       std::unique_ptr<CachedTokensToks = nullptr)
1200      : Param(P), Toks(std::move(Toks)) { }
1201
1202    /// Param - The parameter declaration for this parameter.
1203    Decl *Param;
1204
1205    /// Toks - The sequence of tokens that comprises the default
1206    /// argument expression, not including the '=' or the terminating
1207    /// ')' or ','. This will be NULL for parameters that have no
1208    /// default argument.
1209    std::unique_ptr<CachedTokensToks;
1210  };
1211
1212  /// LateParsedMethodDeclaration - A method declaration inside a class that
1213  /// contains at least one entity whose parsing needs to be delayed
1214  /// until the class itself is completely-defined, such as a default
1215  /// argument (C++ [class.mem]p2).
1216  struct LateParsedMethodDeclaration : public LateParsedDeclaration {
1217    explicit LateParsedMethodDeclaration(Parser *PDecl *M)
1218      : Self(P), Method(M), TemplateScope(false),
1219        ExceptionSpecTokens(nullptr) {}
1220
1221    void ParseLexedMethodDeclarations() override;
1222
1223    ParserSelf;
1224
1225    /// Method - The method declaration.
1226    Decl *Method;
1227
1228    /// Whether this member function had an associated template
1229    /// scope. When true, D is a template declaration.
1230    /// otherwise, it is a member function declaration.
1231    bool TemplateScope;
1232
1233    /// DefaultArgs - Contains the parameters of the function and
1234    /// their default arguments. At least one of the parameters will
1235    /// have a default argument, but all of the parameters of the
1236    /// method will be stored so that they can be reintroduced into
1237    /// scope at the appropriate times.
1238    SmallVector<LateParsedDefaultArgument8DefaultArgs;
1239
1240    /// The set of tokens that make up an exception-specification that
1241    /// has not yet been parsed.
1242    CachedTokens *ExceptionSpecTokens;
1243  };
1244
1245  /// LateParsedMemberInitializer - An initializer for a non-static class data
1246  /// member whose parsing must to be delayed until the class is completely
1247  /// defined (C++11 [class.mem]p2).
1248  struct LateParsedMemberInitializer : public LateParsedDeclaration {
1249    LateParsedMemberInitializer(Parser *PDecl *FD)
1250      : Self(P), Field(FD) { }
1251
1252    void ParseLexedMemberInitializers() override;
1253
1254    Parser *Self;
1255
1256    /// Field - The field declaration.
1257    Decl *Field;
1258
1259    /// CachedTokens - The sequence of tokens that comprises the initializer,
1260    /// including any leading '='.
1261    CachedTokens Toks;
1262  };
1263
1264  /// LateParsedDeclarationsContainer - During parsing of a top (non-nested)
1265  /// C++ class, its method declarations that contain parts that won't be
1266  /// parsed until after the definition is completed (C++ [class.mem]p2),
1267  /// the method declarations and possibly attached inline definitions
1268  /// will be stored here with the tokens that will be parsed to create those
1269  /// entities.
1270  typedef SmallVector<LateParsedDeclaration*,2LateParsedDeclarationsContainer;
1271
1272  /// Representation of a class that has been parsed, including
1273  /// any member function declarations or definitions that need to be
1274  /// parsed after the corresponding top-level class is complete.
1275  struct ParsingClass {
1276    ParsingClass(Decl *TagOrTemplatebool TopLevelClassbool IsInterface)
1277      : TopLevelClass(TopLevelClass), TemplateScope(false),
1278        IsInterface(IsInterface), TagOrTemplate(TagOrTemplate) { }
1279
1280    /// Whether this is a "top-level" class, meaning that it is
1281    /// not nested within another class.
1282    bool TopLevelClass : 1;
1283
1284    /// Whether this class had an associated template
1285    /// scope. When true, TagOrTemplate is a template declaration;
1286    /// otherwise, it is a tag declaration.
1287    bool TemplateScope : 1;
1288
1289    /// Whether this class is an __interface.
1290    bool IsInterface : 1;
1291
1292    /// The class or class template whose definition we are parsing.
1293    Decl *TagOrTemplate;
1294
1295    /// LateParsedDeclarations - Method declarations, inline definitions and
1296    /// nested classes that contain pieces whose parsing will be delayed until
1297    /// the top-level class is fully defined.
1298    LateParsedDeclarationsContainer LateParsedDeclarations;
1299  };
1300
1301  /// The stack of classes that is currently being
1302  /// parsed. Nested and local classes will be pushed onto this stack
1303  /// when they are parsed, and removed afterward.
1304  std::stack<ParsingClass *> ClassStack;
1305
1306  ParsingClass &getCurrentClass() {
1307     (0) . __assert_fail ("!ClassStack.empty() && \"No lexed method stacks!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 1307, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!ClassStack.empty() && "No lexed method stacks!");
1308    return *ClassStack.top();
1309  }
1310
1311  /// RAII object used to manage the parsing of a class definition.
1312  class ParsingClassDefinition {
1313    Parser &P;
1314    bool Popped;
1315    Sema::ParsingClassState State;
1316
1317  public:
1318    ParsingClassDefinition(Parser &PDecl *TagOrTemplatebool TopLevelClass,
1319                           bool IsInterface)
1320      : P(P), Popped(false),
1321        State(P.PushParsingClass(TagOrTemplateTopLevelClassIsInterface)) {
1322    }
1323
1324    /// Pop this class of the stack.
1325    void Pop() {
1326       (0) . __assert_fail ("!Popped && \"Nested class has already been popped\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 1326, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!Popped && "Nested class has already been popped");
1327      Popped = true;
1328      P.PopParsingClass(State);
1329    }
1330
1331    ~ParsingClassDefinition() {
1332      if (!Popped)
1333        P.PopParsingClass(State);
1334    }
1335  };
1336
1337  /// Contains information about any template-specific
1338  /// information that has been parsed prior to parsing declaration
1339  /// specifiers.
1340  struct ParsedTemplateInfo {
1341    ParsedTemplateInfo()
1342      : Kind(NonTemplate), TemplateParams(nullptr), TemplateLoc() { }
1343
1344    ParsedTemplateInfo(TemplateParameterLists *TemplateParams,
1345                       bool isSpecialization,
1346                       bool lastParameterListWasEmpty = false)
1347      : Kind(isSpecializationExplicitSpecialization : Template),
1348        TemplateParams(TemplateParams),
1349        LastParameterListWasEmpty(lastParameterListWasEmpty) { }
1350
1351    explicit ParsedTemplateInfo(SourceLocation ExternLoc,
1352                                SourceLocation TemplateLoc)
1353      : Kind(ExplicitInstantiation), TemplateParams(nullptr),
1354        ExternLoc(ExternLoc), TemplateLoc(TemplateLoc),
1355        LastParameterListWasEmpty(false){ }
1356
1357    /// The kind of template we are parsing.
1358    enum {
1359      /// We are not parsing a template at all.
1360      NonTemplate = 0,
1361      /// We are parsing a template declaration.
1362      Template,
1363      /// We are parsing an explicit specialization.
1364      ExplicitSpecialization,
1365      /// We are parsing an explicit instantiation.
1366      ExplicitInstantiation
1367    } Kind;
1368
1369    /// The template parameter lists, for template declarations
1370    /// and explicit specializations.
1371    TemplateParameterLists *TemplateParams;
1372
1373    /// The location of the 'extern' keyword, if any, for an explicit
1374    /// instantiation
1375    SourceLocation ExternLoc;
1376
1377    /// The location of the 'template' keyword, for an explicit
1378    /// instantiation.
1379    SourceLocation TemplateLoc;
1380
1381    /// Whether the last template parameter list was empty.
1382    bool LastParameterListWasEmpty;
1383
1384    SourceRange getSourceRange() const LLVM_READONLY;
1385  };
1386
1387  void LexTemplateFunctionForLateParsing(CachedTokens &Toks);
1388  void ParseLateTemplatedFuncDef(LateParsedTemplate &LPT);
1389
1390  static void LateTemplateParserCallback(void *PLateParsedTemplate &LPT);
1391  static void LateTemplateParserCleanupCallback(void *P);
1392
1393  Sema::ParsingClassState
1394  PushParsingClass(Decl *TagOrTemplatebool TopLevelClassbool IsInterface);
1395  void DeallocateParsedClasses(ParsingClass *Class);
1396  void PopParsingClass(Sema::ParsingClassState);
1397
1398  enum CachedInitKind {
1399    CIK_DefaultArgument,
1400    CIK_DefaultInitializer
1401  };
1402
1403  NamedDecl *ParseCXXInlineMethodDef(AccessSpecifier AS,
1404                                     ParsedAttributes &AccessAttrs,
1405                                     ParsingDeclarator &D,
1406                                     const ParsedTemplateInfo &TemplateInfo,
1407                                     const VirtSpecifiers &VS,
1408                                     SourceLocation PureSpecLoc);
1409  void ParseCXXNonStaticMemberInitializer(Decl *VarD);
1410  void ParseLexedAttributes(ParsingClass &Class);
1411  void ParseLexedAttributeList(LateParsedAttrList &LAsDecl *D,
1412                               bool EnterScopebool OnDefinition);
1413  void ParseLexedAttribute(LateParsedAttribute &LA,
1414                           bool EnterScopebool OnDefinition);
1415  void ParseLexedMethodDeclarations(ParsingClass &Class);
1416  void ParseLexedMethodDeclaration(LateParsedMethodDeclaration &LM);
1417  void ParseLexedMethodDefs(ParsingClass &Class);
1418  void ParseLexedMethodDef(LexedMethod &LM);
1419  void ParseLexedMemberInitializers(ParsingClass &Class);
1420  void ParseLexedMemberInitializer(LateParsedMemberInitializer &MI);
1421  void ParseLexedObjCMethodDefs(LexedMethod &LMbool parseMethod);
1422  bool ConsumeAndStoreFunctionPrologue(CachedTokens &Toks);
1423  bool ConsumeAndStoreInitializer(CachedTokens &ToksCachedInitKind CIK);
1424  bool ConsumeAndStoreConditional(CachedTokens &Toks);
1425  bool ConsumeAndStoreUntil(tok::TokenKind T1,
1426                            CachedTokens &Toks,
1427                            bool StopAtSemi = true,
1428                            bool ConsumeFinalToken = true) {
1429    return ConsumeAndStoreUntil(T1T1ToksStopAtSemiConsumeFinalToken);
1430  }
1431  bool ConsumeAndStoreUntil(tok::TokenKind T1tok::TokenKind T2,
1432                            CachedTokens &Toks,
1433                            bool StopAtSemi = true,
1434                            bool ConsumeFinalToken = true);
1435
1436  //===--------------------------------------------------------------------===//
1437  // C99 6.9: External Definitions.
1438  struct ParsedAttributesWithRange : ParsedAttributes {
1439    ParsedAttributesWithRange(AttributeFactory &factory)
1440      : ParsedAttributes(factory) {}
1441
1442    void clear() {
1443      ParsedAttributes::clear();
1444      Range = SourceRange();
1445    }
1446
1447    SourceRange Range;
1448  };
1449  struct ParsedAttributesViewWithRange : ParsedAttributesView {
1450    ParsedAttributesViewWithRange() : ParsedAttributesView() {}
1451    void clearListOnly() {
1452      ParsedAttributesView::clearListOnly();
1453      Range = SourceRange();
1454    }
1455
1456    SourceRange Range;
1457  };
1458
1459  DeclGroupPtrTy ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
1460                                          ParsingDeclSpec *DS = nullptr);
1461  bool isDeclarationAfterDeclarator();
1462  bool isStartOfFunctionDefinition(const ParsingDeclarator &Declarator);
1463  DeclGroupPtrTy ParseDeclarationOrFunctionDefinition(
1464                                                  ParsedAttributesWithRange &attrs,
1465                                                  ParsingDeclSpec *DS = nullptr,
1466                                                  AccessSpecifier AS = AS_none);
1467  DeclGroupPtrTy ParseDeclOrFunctionDefInternal(ParsedAttributesWithRange &attrs,
1468                                                ParsingDeclSpec &DS,
1469                                                AccessSpecifier AS);
1470
1471  void SkipFunctionBody();
1472  Decl *ParseFunctionDefinition(ParsingDeclarator &D,
1473                 const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
1474                 LateParsedAttrList *LateParsedAttrs = nullptr);
1475  void ParseKNRParamDeclarations(Declarator &D);
1476  // EndLoc, if non-NULL, is filled with the location of the last token of
1477  // the simple-asm.
1478  ExprResult ParseSimpleAsm(SourceLocation *EndLoc = nullptr);
1479  ExprResult ParseAsmStringLiteral();
1480
1481  // Objective-C External Declarations
1482  void MaybeSkipAttributes(tok::ObjCKeywordKind Kind);
1483  DeclGroupPtrTy ParseObjCAtDirectives(ParsedAttributesWithRange &Attrs);
1484  DeclGroupPtrTy ParseObjCAtClassDeclaration(SourceLocation atLoc);
1485  Decl *ParseObjCAtInterfaceDeclaration(SourceLocation AtLoc,
1486                                        ParsedAttributes &prefixAttrs);
1487  class ObjCTypeParamListScope;
1488  ObjCTypeParamList *parseObjCTypeParamList();
1489  ObjCTypeParamList *parseObjCTypeParamListOrProtocolRefs(
1490      ObjCTypeParamListScope &ScopeSourceLocation &lAngleLoc,
1491      SmallVectorImpl<IdentifierLocPair> &protocolIdents,
1492      SourceLocation &rAngleLocbool mayBeProtocolList = true);
1493
1494  void HelperActionsForIvarDeclarations(Decl *interfaceDeclSourceLocation atLoc,
1495                                        BalancedDelimiterTracker &T,
1496                                        SmallVectorImpl<Decl *> &AllIvarDecls,
1497                                        bool RBraceMissing);
1498  void ParseObjCClassInstanceVariables(Decl *interfaceDecl,
1499                                       tok::ObjCKeywordKind visibility,
1500                                       SourceLocation atLoc);
1501  bool ParseObjCProtocolReferences(SmallVectorImpl<Decl *> &P,
1502                                   SmallVectorImpl<SourceLocation> &PLocs,
1503                                   bool WarnOnDeclarations,
1504                                   bool ForObjCContainer,
1505                                   SourceLocation &LAngleLoc,
1506                                   SourceLocation &EndProtoLoc,
1507                                   bool consumeLastToken);
1508
1509  /// Parse the first angle-bracket-delimited clause for an
1510  /// Objective-C object or object pointer type, which may be either
1511  /// type arguments or protocol qualifiers.
1512  void parseObjCTypeArgsOrProtocolQualifiers(
1513         ParsedType baseType,
1514         SourceLocation &typeArgsLAngleLoc,
1515         SmallVectorImpl<ParsedType> &typeArgs,
1516         SourceLocation &typeArgsRAngleLoc,
1517         SourceLocation &protocolLAngleLoc,
1518         SmallVectorImpl<Decl *> &protocols,
1519         SmallVectorImpl<SourceLocation> &protocolLocs,
1520         SourceLocation &protocolRAngleLoc,
1521         bool consumeLastToken,
1522         bool warnOnIncompleteProtocols);
1523
1524  /// Parse either Objective-C type arguments or protocol qualifiers; if the
1525  /// former, also parse protocol qualifiers afterward.
1526  void parseObjCTypeArgsAndProtocolQualifiers(
1527         ParsedType baseType,
1528         SourceLocation &typeArgsLAngleLoc,
1529         SmallVectorImpl<ParsedType> &typeArgs,
1530         SourceLocation &typeArgsRAngleLoc,
1531         SourceLocation &protocolLAngleLoc,
1532         SmallVectorImpl<Decl *> &protocols,
1533         SmallVectorImpl<SourceLocation> &protocolLocs,
1534         SourceLocation &protocolRAngleLoc,
1535         bool consumeLastToken);
1536
1537  /// Parse a protocol qualifier type such as '<NSCopying>', which is
1538  /// an anachronistic way of writing 'id<NSCopying>'.
1539  TypeResult parseObjCProtocolQualifierType(SourceLocation &rAngleLoc);
1540
1541  /// Parse Objective-C type arguments and protocol qualifiers, extending the
1542  /// current type with the parsed result.
1543  TypeResult parseObjCTypeArgsAndProtocolQualifiers(SourceLocation loc,
1544                                                    ParsedType type,
1545                                                    bool consumeLastToken,
1546                                                    SourceLocation &endLoc);
1547
1548  void ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
1549                                  Decl *CDecl);
1550  DeclGroupPtrTy ParseObjCAtProtocolDeclaration(SourceLocation atLoc,
1551                                                ParsedAttributes &prefixAttrs);
1552
1553  struct ObjCImplParsingDataRAII {
1554    Parser &P;
1555    Decl *Dcl;
1556    bool HasCFunction;
1557    typedef SmallVector<LexedMethod*, 8LateParsedObjCMethodContainer;
1558    LateParsedObjCMethodContainer LateParsedObjCMethods;
1559
1560    ObjCImplParsingDataRAII(Parser &parserDecl *D)
1561      : P(parser), Dcl(D), HasCFunction(false) {
1562      P.CurParsedObjCImpl = this;
1563      Finished = false;
1564    }
1565    ~ObjCImplParsingDataRAII();
1566
1567    void finish(SourceRange AtEnd);
1568    bool isFinished() const { return Finished; }
1569
1570  private:
1571    bool Finished;
1572  };
1573  ObjCImplParsingDataRAII *CurParsedObjCImpl;
1574  void StashAwayMethodOrFunctionBodyTokens(Decl *MDecl);
1575
1576  DeclGroupPtrTy ParseObjCAtImplementationDeclaration(SourceLocation AtLoc);
1577  DeclGroupPtrTy ParseObjCAtEndDeclaration(SourceRange atEnd);
1578  Decl *ParseObjCAtAliasDeclaration(SourceLocation atLoc);
1579  Decl *ParseObjCPropertySynthesize(SourceLocation atLoc);
1580  Decl *ParseObjCPropertyDynamic(SourceLocation atLoc);
1581
1582  IdentifierInfo *ParseObjCSelectorPiece(SourceLocation &MethodLocation);
1583  // Definitions for Objective-c context sensitive keywords recognition.
1584  enum ObjCTypeQual {
1585    objc_in=0objc_outobjc_inoutobjc_onewayobjc_bycopyobjc_byref,
1586    objc_nonnullobjc_nullableobjc_null_unspecified,
1587    objc_NumQuals
1588  };
1589  IdentifierInfo *ObjCTypeQuals[objc_NumQuals];
1590
1591  bool isTokIdentifier_in() const;
1592
1593  ParsedType ParseObjCTypeName(ObjCDeclSpec &DSDeclaratorContext Ctx,
1594                               ParsedAttributes *ParamAttrs);
1595  void ParseObjCMethodRequirement();
1596  Decl *ParseObjCMethodPrototype(
1597            tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword,
1598            bool MethodDefinition = true);
1599  Decl *ParseObjCMethodDecl(SourceLocation mLoctok::TokenKind mType,
1600            tok::ObjCKeywordKind MethodImplKind = tok::objc_not_keyword,
1601            bool MethodDefinition=true);
1602  void ParseObjCPropertyAttribute(ObjCDeclSpec &DS);
1603
1604  Decl *ParseObjCMethodDefinition();
1605
1606public:
1607  //===--------------------------------------------------------------------===//
1608  // C99 6.5: Expressions.
1609
1610  /// TypeCastState - State whether an expression is or may be a type cast.
1611  enum TypeCastState {
1612    NotTypeCast = 0,
1613    MaybeTypeCast,
1614    IsTypeCast
1615  };
1616
1617  ExprResult ParseExpression(TypeCastState isTypeCast = NotTypeCast);
1618  ExprResult ParseConstantExpressionInExprEvalContext(
1619      TypeCastState isTypeCast = NotTypeCast);
1620  ExprResult ParseConstantExpression(TypeCastState isTypeCast = NotTypeCast);
1621  ExprResult ParseCaseExpression(SourceLocation CaseLoc);
1622  ExprResult ParseConstraintExpression();
1623  // Expr that doesn't include commas.
1624  ExprResult ParseAssignmentExpression(TypeCastState isTypeCast = NotTypeCast);
1625
1626  ExprResult ParseMSAsmIdentifier(llvm::SmallVectorImpl<Token> &LineToks,
1627                                  unsigned &NumLineToksConsumed,
1628                                  bool IsUnevaluated);
1629
1630private:
1631  ExprResult ParseExpressionWithLeadingAt(SourceLocation AtLoc);
1632
1633  ExprResult ParseExpressionWithLeadingExtension(SourceLocation ExtLoc);
1634
1635  ExprResult ParseRHSOfBinaryExpression(ExprResult LHS,
1636                                        prec::Level MinPrec);
1637  ExprResult ParseCastExpression(bool isUnaryExpression,
1638                                 bool isAddressOfOperand,
1639                                 bool &NotCastExpr,
1640                                 TypeCastState isTypeCast,
1641                                 bool isVectorLiteral = false);
1642  ExprResult ParseCastExpression(bool isUnaryExpression,
1643                                 bool isAddressOfOperand = false,
1644                                 TypeCastState isTypeCast = NotTypeCast,
1645                                 bool isVectorLiteral = false);
1646
1647  /// Returns true if the next token cannot start an expression.
1648  bool isNotExpressionStart();
1649
1650  /// Returns true if the next token would start a postfix-expression
1651  /// suffix.
1652  bool isPostfixExpressionSuffixStart() {
1653    tok::TokenKind K = Tok.getKind();
1654    return (K == tok::l_square || K == tok::l_paren ||
1655            K == tok::period || K == tok::arrow ||
1656            K == tok::plusplus || K == tok::minusminus);
1657  }
1658
1659  bool diagnoseUnknownTemplateId(ExprResult TemplateNameSourceLocation Less);
1660  void checkPotentialAngleBracket(ExprResult &PotentialTemplateName);
1661  bool checkPotentialAngleBracketDelimiter(const AngleBracketTracker::Loc &,
1662                                           const Token &OpToken);
1663  bool checkPotentialAngleBracketDelimiter(const Token &OpToken) {
1664    if (auto *Info = AngleBrackets.getCurrent(*this))
1665      return checkPotentialAngleBracketDelimiter(*Info, OpToken);
1666    return false;
1667  }
1668
1669  ExprResult ParsePostfixExpressionSuffix(ExprResult LHS);
1670  ExprResult ParseUnaryExprOrTypeTraitExpression();
1671  ExprResult ParseBuiltinPrimaryExpression();
1672
1673  ExprResult ParseExprAfterUnaryExprOrTypeTrait(const Token &OpTok,
1674                                                     bool &isCastExpr,
1675                                                     ParsedType &CastTy,
1676                                                     SourceRange &CastRange);
1677
1678  typedef SmallVector<Expr*, 20ExprListTy;
1679  typedef SmallVector<SourceLocation20CommaLocsTy;
1680
1681  /// ParseExpressionList - Used for C/C++ (argument-)expression-list.
1682  bool ParseExpressionList(SmallVectorImpl<Expr *> &Exprs,
1683                           SmallVectorImpl<SourceLocation> &CommaLocs,
1684                           llvm::function_ref<void()> ExpressionStarts =
1685                               llvm::function_ref<void()>());
1686
1687  /// ParseSimpleExpressionList - A simple comma-separated list of expressions,
1688  /// used for misc language extensions.
1689  bool ParseSimpleExpressionList(SmallVectorImpl<Expr*> &Exprs,
1690                                 SmallVectorImpl<SourceLocation> &CommaLocs);
1691
1692
1693  /// ParenParseOption - Control what ParseParenExpression will parse.
1694  enum ParenParseOption {
1695    SimpleExpr,      // Only parse '(' expression ')'
1696    FoldExpr,        // Also allow fold-expression <anything>
1697    CompoundStmt,    // Also allow '(' compound-statement ')'
1698    CompoundLiteral// Also allow '(' type-name ')' '{' ... '}'
1699    CastExpr         // Also allow '(' type-name ')' <anything>
1700  };
1701  ExprResult ParseParenExpression(ParenParseOption &ExprType,
1702                                        bool stopIfCastExpr,
1703                                        bool isTypeCast,
1704                                        ParsedType &CastTy,
1705                                        SourceLocation &RParenLoc);
1706
1707  ExprResult ParseCXXAmbiguousParenExpression(
1708      ParenParseOption &ExprTypeParsedType &CastTy,
1709      BalancedDelimiterTracker &TrackerColonProtectionRAIIObject &ColonProt);
1710  ExprResult ParseCompoundLiteralExpression(ParsedType Ty,
1711                                                  SourceLocation LParenLoc,
1712                                                  SourceLocation RParenLoc);
1713
1714  ExprResult ParseStringLiteralExpression(bool AllowUserDefinedLiteral = false);
1715
1716  ExprResult ParseGenericSelectionExpression();
1717
1718  ExprResult ParseObjCBoolLiteral();
1719
1720  ExprResult ParseFoldExpression(ExprResult LHSBalancedDelimiterTracker &T);
1721
1722  //===--------------------------------------------------------------------===//
1723  // C++ Expressions
1724  ExprResult tryParseCXXIdExpression(CXXScopeSpec &SSbool isAddressOfOperand,
1725                                     Token &Replacement);
1726  ExprResult ParseCXXIdExpression(bool isAddressOfOperand = false);
1727
1728  bool areTokensAdjacent(const Token &Aconst Token &B);
1729
1730  void CheckForTemplateAndDigraph(Token &NextParsedType ObjectTypePtr,
1731                                  bool EnteringContextIdentifierInfo &II,
1732                                  CXXScopeSpec &SS);
1733
1734  bool ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
1735                                      ParsedType ObjectType,
1736                                      bool EnteringContext,
1737                                      bool *MayBePseudoDestructor = nullptr,
1738                                      bool IsTypename = false,
1739                                      IdentifierInfo **LastII = nullptr,
1740                                      bool OnlyNamespace = false);
1741
1742  //===--------------------------------------------------------------------===//
1743  // C++0x 5.1.2: Lambda expressions
1744
1745  // [...] () -> type {...}
1746  ExprResult ParseLambdaExpression();
1747  ExprResult TryParseLambdaExpression();
1748  Optional<unsignedParseLambdaIntroducer(LambdaIntroducer &Intro,
1749                                           bool *SkippedInits = nullptr);
1750  bool TryParseLambdaIntroducer(LambdaIntroducer &Intro);
1751  ExprResult ParseLambdaExpressionAfterIntroducer(
1752               LambdaIntroducer &Intro);
1753
1754  //===--------------------------------------------------------------------===//
1755  // C++ 5.2p1: C++ Casts
1756  ExprResult ParseCXXCasts();
1757
1758  //===--------------------------------------------------------------------===//
1759  // C++ 5.2p1: C++ Type Identification
1760  ExprResult ParseCXXTypeid();
1761
1762  //===--------------------------------------------------------------------===//
1763  //  C++ : Microsoft __uuidof Expression
1764  ExprResult ParseCXXUuidof();
1765
1766  //===--------------------------------------------------------------------===//
1767  // C++ 5.2.4: C++ Pseudo-Destructor Expressions
1768  ExprResult ParseCXXPseudoDestructor(Expr *BaseSourceLocation OpLoc,
1769                                            tok::TokenKind OpKind,
1770                                            CXXScopeSpec &SS,
1771                                            ParsedType ObjectType);
1772
1773  //===--------------------------------------------------------------------===//
1774  // C++ 9.3.2: C++ 'this' pointer
1775  ExprResult ParseCXXThis();
1776
1777  //===--------------------------------------------------------------------===//
1778  // C++ 15: C++ Throw Expression
1779  ExprResult ParseThrowExpression();
1780
1781  ExceptionSpecificationType tryParseExceptionSpecification(
1782                    bool Delayed,
1783                    SourceRange &SpecificationRange,
1784                    SmallVectorImpl<ParsedType> &DynamicExceptions,
1785                    SmallVectorImpl<SourceRange> &DynamicExceptionRanges,
1786                    ExprResult &NoexceptExpr,
1787                    CachedTokens *&ExceptionSpecTokens);
1788
1789  // EndLoc is filled with the location of the last token of the specification.
1790  ExceptionSpecificationType ParseDynamicExceptionSpecification(
1791                                  SourceRange &SpecificationRange,
1792                                  SmallVectorImpl<ParsedType> &Exceptions,
1793                                  SmallVectorImpl<SourceRange> &Ranges);
1794
1795  //===--------------------------------------------------------------------===//
1796  // C++0x 8: Function declaration trailing-return-type
1797  TypeResult ParseTrailingReturnType(SourceRange &Range,
1798                                     bool MayBeFollowedByDirectInit);
1799
1800  //===--------------------------------------------------------------------===//
1801  // C++ 2.13.5: C++ Boolean Literals
1802  ExprResult ParseCXXBoolLiteral();
1803
1804  //===--------------------------------------------------------------------===//
1805  // C++ 5.2.3: Explicit type conversion (functional notation)
1806  ExprResult ParseCXXTypeConstructExpression(const DeclSpec &DS);
1807
1808  /// ParseCXXSimpleTypeSpecifier - [C++ 7.1.5.2] Simple type specifiers.
1809  /// This should only be called when the current token is known to be part of
1810  /// simple-type-specifier.
1811  void ParseCXXSimpleTypeSpecifier(DeclSpec &DS);
1812
1813  bool ParseCXXTypeSpecifierSeq(DeclSpec &DS);
1814
1815  //===--------------------------------------------------------------------===//
1816  // C++ 5.3.4 and 5.3.5: C++ new and delete
1817  bool ParseExpressionListOrTypeId(SmallVectorImpl<Expr*> &Exprs,
1818                                   Declarator &D);
1819  void ParseDirectNewDeclarator(Declarator &D);
1820  ExprResult ParseCXXNewExpression(bool UseGlobalSourceLocation Start);
1821  ExprResult ParseCXXDeleteExpression(bool UseGlobal,
1822                                            SourceLocation Start);
1823
1824  //===--------------------------------------------------------------------===//
1825  // C++ if/switch/while/for condition expression.
1826  struct ForRangeInfo;
1827  Sema::ConditionResult ParseCXXCondition(StmtResult *InitStmt,
1828                                          SourceLocation Loc,
1829                                          Sema::ConditionKind CK,
1830                                          ForRangeInfo *FRI = nullptr);
1831
1832  //===--------------------------------------------------------------------===//
1833  // C++ Coroutines
1834
1835  ExprResult ParseCoyieldExpression();
1836
1837  //===--------------------------------------------------------------------===//
1838  // C99 6.7.8: Initialization.
1839
1840  /// ParseInitializer
1841  ///       initializer: [C99 6.7.8]
1842  ///         assignment-expression
1843  ///         '{' ...
1844  ExprResult ParseInitializer() {
1845    if (Tok.isNot(tok::l_brace))
1846      return ParseAssignmentExpression();
1847    return ParseBraceInitializer();
1848  }
1849  bool MayBeDesignationStart();
1850  ExprResult ParseBraceInitializer();
1851  ExprResult ParseInitializerWithPotentialDesignator();
1852
1853  //===--------------------------------------------------------------------===//
1854  // clang Expressions
1855
1856  ExprResult ParseBlockLiteralExpression();  // ^{...}
1857
1858  //===--------------------------------------------------------------------===//
1859  // Objective-C Expressions
1860  ExprResult ParseObjCAtExpression(SourceLocation AtLocation);
1861  ExprResult ParseObjCStringLiteral(SourceLocation AtLoc);
1862  ExprResult ParseObjCCharacterLiteral(SourceLocation AtLoc);
1863  ExprResult ParseObjCNumericLiteral(SourceLocation AtLoc);
1864  ExprResult ParseObjCBooleanLiteral(SourceLocation AtLocbool ArgValue);
1865  ExprResult ParseObjCArrayLiteral(SourceLocation AtLoc);
1866  ExprResult ParseObjCDictionaryLiteral(SourceLocation AtLoc);
1867  ExprResult ParseObjCBoxedExpr(SourceLocation AtLoc);
1868  ExprResult ParseObjCEncodeExpression(SourceLocation AtLoc);
1869  ExprResult ParseObjCSelectorExpression(SourceLocation AtLoc);
1870  ExprResult ParseObjCProtocolExpression(SourceLocation AtLoc);
1871  bool isSimpleObjCMessageExpression();
1872  ExprResult ParseObjCMessageExpression();
1873  ExprResult ParseObjCMessageExpressionBody(SourceLocation LBracloc,
1874                                            SourceLocation SuperLoc,
1875                                            ParsedType ReceiverType,
1876                                            Expr *ReceiverExpr);
1877  ExprResult ParseAssignmentExprWithObjCMessageExprStart(
1878      SourceLocation LBraclocSourceLocation SuperLoc,
1879      ParsedType ReceiverTypeExpr *ReceiverExpr);
1880  bool ParseObjCXXMessageReceiver(bool &IsExprvoid *&TypeOrExpr);
1881
1882  //===--------------------------------------------------------------------===//
1883  // C99 6.8: Statements and Blocks.
1884
1885  /// A SmallVector of statements, with stack size 32 (as that is the only one
1886  /// used.)
1887  typedef SmallVector<Stmt*, 32StmtVector;
1888  /// A SmallVector of expressions, with stack size 12 (the maximum used.)
1889  typedef SmallVector<Expr*, 12ExprVector;
1890  /// A SmallVector of types.
1891  typedef SmallVector<ParsedType12TypeVector;
1892
1893  StmtResult
1894  ParseStatement(SourceLocation *TrailingElseLoc = nullptr,
1895                 ParsedStmtContext StmtCtx = ParsedStmtContext::SubStmt);
1896  StmtResult ParseStatementOrDeclaration(
1897      StmtVector &StmtsParsedStmtContext StmtCtx,
1898      SourceLocation *TrailingElseLoc = nullptr);
1899  StmtResult ParseStatementOrDeclarationAfterAttributes(
1900                                         StmtVector &Stmts,
1901                                         ParsedStmtContext StmtCtx,
1902                                         SourceLocation *TrailingElseLoc,
1903                                         ParsedAttributesWithRange &Attrs);
1904  StmtResult ParseExprStatement(ParsedStmtContext StmtCtx);
1905  StmtResult ParseLabeledStatement(ParsedAttributesWithRange &attrs,
1906                                   ParsedStmtContext StmtCtx);
1907  StmtResult ParseCaseStatement(ParsedStmtContext StmtCtx,
1908                                bool MissingCase = false,
1909                                ExprResult Expr = ExprResult());
1910  StmtResult ParseDefaultStatement(ParsedStmtContext StmtCtx);
1911  StmtResult ParseCompoundStatement(bool isStmtExpr = false);
1912  StmtResult ParseCompoundStatement(bool isStmtExpr,
1913                                    unsigned ScopeFlags);
1914  void ParseCompoundStatementLeadingPragmas();
1915  bool ConsumeNullStmt(StmtVector &Stmts);
1916  StmtResult ParseCompoundStatementBody(bool isStmtExpr = false);
1917  bool ParseParenExprOrCondition(StmtResult *InitStmt,
1918                                 Sema::ConditionResult &CondResult,
1919                                 SourceLocation Loc,
1920                                 Sema::ConditionKind CK);
1921  StmtResult ParseIfStatement(SourceLocation *TrailingElseLoc);
1922  StmtResult ParseSwitchStatement(SourceLocation *TrailingElseLoc);
1923  StmtResult ParseWhileStatement(SourceLocation *TrailingElseLoc);
1924  StmtResult ParseDoStatement();
1925  StmtResult ParseForStatement(SourceLocation *TrailingElseLoc);
1926  StmtResult ParseGotoStatement();
1927  StmtResult ParseContinueStatement();
1928  StmtResult ParseBreakStatement();
1929  StmtResult ParseReturnStatement();
1930  StmtResult ParseAsmStatement(bool &msAsm);
1931  StmtResult ParseMicrosoftAsmStatement(SourceLocation AsmLoc);
1932  StmtResult ParsePragmaLoopHint(StmtVector &Stmts,
1933                                 ParsedStmtContext StmtCtx,
1934                                 SourceLocation *TrailingElseLoc,
1935                                 ParsedAttributesWithRange &Attrs);
1936
1937  /// Describes the behavior that should be taken for an __if_exists
1938  /// block.
1939  enum IfExistsBehavior {
1940    /// Parse the block; this code is always used.
1941    IEB_Parse,
1942    /// Skip the block entirely; this code is never used.
1943    IEB_Skip,
1944    /// Parse the block as a dependent block, which may be used in
1945    /// some template instantiations but not others.
1946    IEB_Dependent
1947  };
1948
1949  /// Describes the condition of a Microsoft __if_exists or
1950  /// __if_not_exists block.
1951  struct IfExistsCondition {
1952    /// The location of the initial keyword.
1953    SourceLocation KeywordLoc;
1954    /// Whether this is an __if_exists block (rather than an
1955    /// __if_not_exists block).
1956    bool IsIfExists;
1957
1958    /// Nested-name-specifier preceding the name.
1959    CXXScopeSpec SS;
1960
1961    /// The name we're looking for.
1962    UnqualifiedId Name;
1963
1964    /// The behavior of this __if_exists or __if_not_exists block
1965    /// should.
1966    IfExistsBehavior Behavior;
1967  };
1968
1969  bool ParseMicrosoftIfExistsCondition(IfExistsConditionResult);
1970  void ParseMicrosoftIfExistsStatement(StmtVector &Stmts);
1971  void ParseMicrosoftIfExistsExternalDeclaration();
1972  void ParseMicrosoftIfExistsClassDeclaration(DeclSpec::TST TagType,
1973                                              ParsedAttributes &AccessAttrs,
1974                                              AccessSpecifier &CurAS);
1975  bool ParseMicrosoftIfExistsBraceInitializer(ExprVector &InitExprs,
1976                                              bool &InitExprsOk);
1977  bool ParseAsmOperandsOpt(SmallVectorImpl<IdentifierInfo *> &Names,
1978                           SmallVectorImpl<Expr *> &Constraints,
1979                           SmallVectorImpl<Expr *> &Exprs);
1980
1981  //===--------------------------------------------------------------------===//
1982  // C++ 6: Statements and Blocks
1983
1984  StmtResult ParseCXXTryBlock();
1985  StmtResult ParseCXXTryBlockCommon(SourceLocation TryLocbool FnTry = false);
1986  StmtResult ParseCXXCatchBlock(bool FnCatch = false);
1987
1988  //===--------------------------------------------------------------------===//
1989  // MS: SEH Statements and Blocks
1990
1991  StmtResult ParseSEHTryBlock();
1992  StmtResult ParseSEHExceptBlock(SourceLocation Loc);
1993  StmtResult ParseSEHFinallyBlock(SourceLocation Loc);
1994  StmtResult ParseSEHLeaveStatement();
1995
1996  //===--------------------------------------------------------------------===//
1997  // Objective-C Statements
1998
1999  StmtResult ParseObjCAtStatement(SourceLocation atLoc,
2000                                  ParsedStmtContext StmtCtx);
2001  StmtResult ParseObjCTryStmt(SourceLocation atLoc);
2002  StmtResult ParseObjCThrowStmt(SourceLocation atLoc);
2003  StmtResult ParseObjCSynchronizedStmt(SourceLocation atLoc);
2004  StmtResult ParseObjCAutoreleasePoolStmt(SourceLocation atLoc);
2005
2006
2007  //===--------------------------------------------------------------------===//
2008  // C99 6.7: Declarations.
2009
2010  /// A context for parsing declaration specifiers.  TODO: flesh this
2011  /// out, there are other significant restrictions on specifiers than
2012  /// would be best implemented in the parser.
2013  enum class DeclSpecContext {
2014    DSC_normal// normal context
2015    DSC_class,  // class context, enables 'friend'
2016    DSC_type_specifier// C++ type-specifier-seq or C specifier-qualifier-list
2017    DSC_trailing// C++11 trailing-type-specifier in a trailing return type
2018    DSC_alias_declaration// C++11 type-specifier-seq in an alias-declaration
2019    DSC_top_level// top-level/namespace declaration context
2020    DSC_template_param// template parameter context
2021    DSC_template_type_arg// template type argument context
2022    DSC_objc_method_result// ObjC method result context, enables 'instancetype'
2023    DSC_condition // condition declaration context
2024  };
2025
2026  /// Is this a context in which we are parsing just a type-specifier (or
2027  /// trailing-type-specifier)?
2028  static bool isTypeSpecifier(DeclSpecContext DSC) {
2029    switch (DSC) {
2030    case DeclSpecContext::DSC_normal:
2031    case DeclSpecContext::DSC_template_param:
2032    case DeclSpecContext::DSC_class:
2033    case DeclSpecContext::DSC_top_level:
2034    case DeclSpecContext::DSC_objc_method_result:
2035    case DeclSpecContext::DSC_condition:
2036      return false;
2037
2038    case DeclSpecContext::DSC_template_type_arg:
2039    case DeclSpecContext::DSC_type_specifier:
2040    case DeclSpecContext::DSC_trailing:
2041    case DeclSpecContext::DSC_alias_declaration:
2042      return true;
2043    }
2044    llvm_unreachable("Missing DeclSpecContext case");
2045  }
2046
2047  /// Is this a context in which we can perform class template argument
2048  /// deduction?
2049  static bool isClassTemplateDeductionContext(DeclSpecContext DSC) {
2050    switch (DSC) {
2051    case DeclSpecContext::DSC_normal:
2052    case DeclSpecContext::DSC_template_param:
2053    case DeclSpecContext::DSC_class:
2054    case DeclSpecContext::DSC_top_level:
2055    case DeclSpecContext::DSC_condition:
2056    case DeclSpecContext::DSC_type_specifier:
2057      return true;
2058
2059    case DeclSpecContext::DSC_objc_method_result:
2060    case DeclSpecContext::DSC_template_type_arg:
2061    case DeclSpecContext::DSC_trailing:
2062    case DeclSpecContext::DSC_alias_declaration:
2063      return false;
2064    }
2065    llvm_unreachable("Missing DeclSpecContext case");
2066  }
2067
2068  /// Information on a C++0x for-range-initializer found while parsing a
2069  /// declaration which turns out to be a for-range-declaration.
2070  struct ForRangeInit {
2071    SourceLocation ColonLoc;
2072    ExprResult RangeExpr;
2073
2074    bool ParsedForRangeDecl() { return !ColonLoc.isInvalid(); }
2075  };
2076  struct ForRangeInfo : ForRangeInit {
2077    StmtResult LoopVar;
2078  };
2079
2080  DeclGroupPtrTy ParseDeclaration(DeclaratorContext Context,
2081                                  SourceLocation &DeclEnd,
2082                                  ParsedAttributesWithRange &attrs);
2083  DeclGroupPtrTy ParseSimpleDeclaration(DeclaratorContext Context,
2084                                        SourceLocation &DeclEnd,
2085                                        ParsedAttributesWithRange &attrs,
2086                                        bool RequireSemi,
2087                                        ForRangeInit *FRI = nullptr);
2088  bool MightBeDeclarator(DeclaratorContext Context);
2089  DeclGroupPtrTy ParseDeclGroup(ParsingDeclSpec &DSDeclaratorContext Context,
2090                                SourceLocation *DeclEnd = nullptr,
2091                                ForRangeInit *FRI = nullptr);
2092  Decl *ParseDeclarationAfterDeclarator(Declarator &D,
2093               const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo());
2094  bool ParseAsmAttributesAfterDeclarator(Declarator &D);
2095  Decl *ParseDeclarationAfterDeclaratorAndAttributes(
2096      Declarator &D,
2097      const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
2098      ForRangeInit *FRI = nullptr);
2099  Decl *ParseFunctionStatementBody(Decl *DeclParseScope &BodyScope);
2100  Decl *ParseFunctionTryBlock(Decl *DeclParseScope &BodyScope);
2101
2102  /// When in code-completion, skip parsing of the function/method body
2103  /// unless the body contains the code-completion point.
2104  ///
2105  /// \returns true if the function body was skipped.
2106  bool trySkippingFunctionBody();
2107
2108  bool ParseImplicitInt(DeclSpec &DSCXXScopeSpec *SS,
2109                        const ParsedTemplateInfo &TemplateInfo,
2110                        AccessSpecifier ASDeclSpecContext DSC,
2111                        ParsedAttributesWithRange &Attrs);
2112  DeclSpecContext
2113  getDeclSpecContextFromDeclaratorContext(DeclaratorContext Context);
2114  void ParseDeclarationSpecifiers(
2115      DeclSpec &DS,
2116      const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
2117      AccessSpecifier AS = AS_none,
2118      DeclSpecContext DSC = DeclSpecContext::DSC_normal,
2119      LateParsedAttrList *LateAttrs = nullptr);
2120  bool DiagnoseMissingSemiAfterTagDefinition(
2121      DeclSpec &DSAccessSpecifier ASDeclSpecContext DSContext,
2122      LateParsedAttrList *LateAttrs = nullptr);
2123
2124  void ParseSpecifierQualifierList(
2125      DeclSpec &DSAccessSpecifier AS = AS_none,
2126      DeclSpecContext DSC = DeclSpecContext::DSC_normal);
2127
2128  void ParseObjCTypeQualifierList(ObjCDeclSpec &DS,
2129                                  DeclaratorContext Context);
2130
2131  void ParseEnumSpecifier(SourceLocation TagLocDeclSpec &DS,
2132                          const ParsedTemplateInfo &TemplateInfo,
2133                          AccessSpecifier ASDeclSpecContext DSC);
2134  void ParseEnumBody(SourceLocation StartLocDecl *TagDecl);
2135  void ParseStructUnionBody(SourceLocation StartLocunsigned TagType,
2136                            Decl *TagDecl);
2137
2138  void ParseStructDeclaration(
2139      ParsingDeclSpec &DS,
2140      llvm::function_ref<void(ParsingFieldDeclarator &)> FieldsCallback);
2141
2142  bool isDeclarationSpecifier(bool DisambiguatingWithExpression = false);
2143  bool isTypeSpecifierQualifier();
2144
2145  /// isKnownToBeTypeSpecifier - Return true if we know that the specified token
2146  /// is definitely a type-specifier.  Return false if it isn't part of a type
2147  /// specifier or if we're not sure.
2148  bool isKnownToBeTypeSpecifier(const Token &Tokconst;
2149
2150  /// Return true if we know that we are definitely looking at a
2151  /// decl-specifier, and isn't part of an expression such as a function-style
2152  /// cast. Return false if it's no a decl-specifier, or we're not sure.
2153  bool isKnownToBeDeclarationSpecifier() {
2154    if (getLangOpts().CPlusPlus)
2155      return isCXXDeclarationSpecifier() == TPResult::True;
2156    return isDeclarationSpecifier(true);
2157  }
2158
2159  /// isDeclarationStatement - Disambiguates between a declaration or an
2160  /// expression statement, when parsing function bodies.
2161  /// Returns true for declaration, false for expression.
2162  bool isDeclarationStatement() {
2163    if (getLangOpts().CPlusPlus)
2164      return isCXXDeclarationStatement();
2165    return isDeclarationSpecifier(true);
2166  }
2167
2168  /// isForInitDeclaration - Disambiguates between a declaration or an
2169  /// expression in the context of the C 'clause-1' or the C++
2170  // 'for-init-statement' part of a 'for' statement.
2171  /// Returns true for declaration, false for expression.
2172  bool isForInitDeclaration() {
2173    if (getLangOpts().OpenMP)
2174      Actions.startOpenMPLoop();
2175    if (getLangOpts().CPlusPlus)
2176      return isCXXSimpleDeclaration(/*AllowForRangeDecl=*/true);
2177    return isDeclarationSpecifier(true);
2178  }
2179
2180  /// Determine whether this is a C++1z for-range-identifier.
2181  bool isForRangeIdentifier();
2182
2183  /// Determine whether we are currently at the start of an Objective-C
2184  /// class message that appears to be missing the open bracket '['.
2185  bool isStartOfObjCClassMessageMissingOpenBracket();
2186
2187  /// Starting with a scope specifier, identifier, or
2188  /// template-id that refers to the current class, determine whether
2189  /// this is a constructor declarator.
2190  bool isConstructorDeclarator(bool Unqualifiedbool DeductionGuide = false);
2191
2192  /// Specifies the context in which type-id/expression
2193  /// disambiguation will occur.
2194  enum TentativeCXXTypeIdContext {
2195    TypeIdInParens,
2196    TypeIdUnambiguous,
2197    TypeIdAsTemplateArgument
2198  };
2199
2200
2201  /// isTypeIdInParens - Assumes that a '(' was parsed and now we want to know
2202  /// whether the parens contain an expression or a type-id.
2203  /// Returns true for a type-id and false for an expression.
2204  bool isTypeIdInParens(bool &isAmbiguous) {
2205    if (getLangOpts().CPlusPlus)
2206      return isCXXTypeId(TypeIdInParensisAmbiguous);
2207    isAmbiguous = false;
2208    return isTypeSpecifierQualifier();
2209  }
2210  bool isTypeIdInParens() {
2211    bool isAmbiguous;
2212    return isTypeIdInParens(isAmbiguous);
2213  }
2214
2215  /// Checks if the current tokens form type-id or expression.
2216  /// It is similar to isTypeIdInParens but does not suppose that type-id
2217  /// is in parenthesis.
2218  bool isTypeIdUnambiguously() {
2219    bool IsAmbiguous;
2220    if (getLangOpts().CPlusPlus)
2221      return isCXXTypeId(TypeIdUnambiguousIsAmbiguous);
2222    return isTypeSpecifierQualifier();
2223  }
2224
2225  /// isCXXDeclarationStatement - C++-specialized function that disambiguates
2226  /// between a declaration or an expression statement, when parsing function
2227  /// bodies. Returns true for declaration, false for expression.
2228  bool isCXXDeclarationStatement();
2229
2230  /// isCXXSimpleDeclaration - C++-specialized function that disambiguates
2231  /// between a simple-declaration or an expression-statement.
2232  /// If during the disambiguation process a parsing error is encountered,
2233  /// the function returns true to let the declaration parsing code handle it.
2234  /// Returns false if the statement is disambiguated as expression.
2235  bool isCXXSimpleDeclaration(bool AllowForRangeDecl);
2236
2237  /// isCXXFunctionDeclarator - Disambiguates between a function declarator or
2238  /// a constructor-style initializer, when parsing declaration statements.
2239  /// Returns true for function declarator and false for constructor-style
2240  /// initializer. Sets 'IsAmbiguous' to true to indicate that this declaration
2241  /// might be a constructor-style initializer.
2242  /// If during the disambiguation process a parsing error is encountered,
2243  /// the function returns true to let the declaration parsing code handle it.
2244  bool isCXXFunctionDeclarator(bool *IsAmbiguous = nullptr);
2245
2246  struct ConditionDeclarationOrInitStatementState;
2247  enum class ConditionOrInitStatement {
2248    Expression,    ///< Disambiguated as an expression (either kind).
2249    ConditionDecl///< Disambiguated as the declaration form of condition.
2250    InitStmtDecl,  ///< Disambiguated as a simple-declaration init-statement.
2251    ForRangeDecl,  ///< Disambiguated as a for-range declaration.
2252    Error          ///< Can't be any of the above!
2253  };
2254  /// Disambiguates between the different kinds of things that can happen
2255  /// after 'if (' or 'switch ('. This could be one of two different kinds of
2256  /// declaration (depending on whether there is a ';' later) or an expression.
2257  ConditionOrInitStatement
2258  isCXXConditionDeclarationOrInitStatement(bool CanBeInitStmt,
2259                                           bool CanBeForRangeDecl);
2260
2261  bool isCXXTypeId(TentativeCXXTypeIdContext Contextbool &isAmbiguous);
2262  bool isCXXTypeId(TentativeCXXTypeIdContext Context) {
2263    bool isAmbiguous;
2264    return isCXXTypeId(ContextisAmbiguous);
2265  }
2266
2267  /// TPResult - Used as the result value for functions whose purpose is to
2268  /// disambiguate C++ constructs by "tentatively parsing" them.
2269  enum class TPResult {
2270    TrueFalseAmbiguousError
2271  };
2272
2273  /// Based only on the given token kind, determine whether we know that
2274  /// we're at the start of an expression or a type-specifier-seq (which may
2275  /// be an expression, in C++).
2276  ///
2277  /// This routine does not attempt to resolve any of the trick cases, e.g.,
2278  /// those involving lookup of identifiers.
2279  ///
2280  /// \returns \c TPR_true if this token starts an expression, \c TPR_false if
2281  /// this token starts a type-specifier-seq, or \c TPR_ambiguous if it cannot
2282  /// tell.
2283  TPResult isExpressionOrTypeSpecifierSimple(tok::TokenKind Kind);
2284
2285  /// isCXXDeclarationSpecifier - Returns TPResult::True if it is a
2286  /// declaration specifier, TPResult::False if it is not,
2287  /// TPResult::Ambiguous if it could be either a decl-specifier or a
2288  /// function-style cast, and TPResult::Error if a parsing error was
2289  /// encountered. If it could be a braced C++11 function-style cast, returns
2290  /// BracedCastResult.
2291  /// Doesn't consume tokens.
2292  TPResult
2293  isCXXDeclarationSpecifier(TPResult BracedCastResult = TPResult::False,
2294                            bool *HasMissingTypename = nullptr);
2295
2296  /// Given that isCXXDeclarationSpecifier returns \c TPResult::True or
2297  /// \c TPResult::Ambiguous, determine whether the decl-specifier would be
2298  /// a type-specifier other than a cv-qualifier.
2299  bool isCXXDeclarationSpecifierAType();
2300
2301  /// Determine whether an identifier has been tentatively declared as a
2302  /// non-type. Such tentative declarations should not be found to name a type
2303  /// during a tentative parse, but also should not be annotated as a non-type.
2304  bool isTentativelyDeclared(IdentifierInfo *II);
2305
2306  // "Tentative parsing" functions, used for disambiguation. If a parsing error
2307  // is encountered they will return TPResult::Error.
2308  // Returning TPResult::True/False indicates that the ambiguity was
2309  // resolved and tentative parsing may stop. TPResult::Ambiguous indicates
2310  // that more tentative parsing is necessary for disambiguation.
2311  // They all consume tokens, so backtracking should be used after calling them.
2312
2313  TPResult TryParseSimpleDeclaration(bool AllowForRangeDecl);
2314  TPResult TryParseTypeofSpecifier();
2315  TPResult TryParseProtocolQualifiers();
2316  TPResult TryParsePtrOperatorSeq();
2317  TPResult TryParseOperatorId();
2318  TPResult TryParseInitDeclaratorList();
2319  TPResult TryParseDeclarator(bool mayBeAbstractbool mayHaveIdentifier = true,
2320                              bool mayHaveDirectInit = false);
2321  TPResult
2322  TryParseParameterDeclarationClause(bool *InvalidAsDeclaration = nullptr,
2323                                     bool VersusTemplateArg = false);
2324  TPResult TryParseFunctionDeclarator();
2325  TPResult TryParseBracketDeclarator();
2326  TPResult TryConsumeDeclarationSpecifier();
2327
2328public:
2329  TypeResult ParseTypeName(SourceRange *Range = nullptr,
2330                           DeclaratorContext Context
2331                             = DeclaratorContext::TypeNameContext,
2332                           AccessSpecifier AS = AS_none,
2333                           Decl **OwnedType = nullptr,
2334                           ParsedAttributes *Attrs = nullptr);
2335
2336private:
2337  void ParseBlockId(SourceLocation CaretLoc);
2338
2339  /// Are [[]] attributes enabled?
2340  bool standardAttributesAllowed() const {
2341    const LangOptions &LO = getLangOpts();
2342    return LO.DoubleSquareBracketAttributes;
2343  }
2344
2345  // Check for the start of an attribute-specifier-seq in a context where an
2346  // attribute is not allowed.
2347  bool CheckProhibitedCXX11Attribute() {
2348    assert(Tok.is(tok::l_square));
2349    if (!standardAttributesAllowed() || NextToken().isNot(tok::l_square))
2350      return false;
2351    return DiagnoseProhibitedCXX11Attribute();
2352  }
2353
2354  bool DiagnoseProhibitedCXX11Attribute();
2355  void CheckMisplacedCXX11Attribute(ParsedAttributesWithRange &Attrs,
2356                                    SourceLocation CorrectLocation) {
2357    if (!standardAttributesAllowed())
2358      return;
2359    if ((Tok.isNot(tok::l_square) || NextToken().isNot(tok::l_square)) &&
2360        Tok.isNot(tok::kw_alignas))
2361      return;
2362    DiagnoseMisplacedCXX11Attribute(AttrsCorrectLocation);
2363  }
2364  void DiagnoseMisplacedCXX11Attribute(ParsedAttributesWithRange &Attrs,
2365                                       SourceLocation CorrectLocation);
2366
2367  void stripTypeAttributesOffDeclSpec(ParsedAttributesWithRange &Attrs,
2368                                      DeclSpec &DSSema::TagUseKind TUK);
2369
2370  // FixItLoc = possible correct location for the attributes
2371  void ProhibitAttributes(ParsedAttributesWithRange &Attrs,
2372                          SourceLocation FixItLoc = SourceLocation()) {
2373    if (Attrs.Range.isInvalid())
2374      return;
2375    DiagnoseProhibitedAttributes(Attrs.RangeFixItLoc);
2376    Attrs.clear();
2377  }
2378
2379  void ProhibitAttributes(ParsedAttributesViewWithRange &Attrs,
2380                          SourceLocation FixItLoc = SourceLocation()) {
2381    if (Attrs.Range.isInvalid())
2382      return;
2383    DiagnoseProhibitedAttributes(Attrs.RangeFixItLoc);
2384    Attrs.clearListOnly();
2385  }
2386  void DiagnoseProhibitedAttributes(const SourceRange &Range,
2387                                    SourceLocation FixItLoc);
2388
2389  // Forbid C++11 and C2x attributes that appear on certain syntactic locations
2390  // which standard permits but we don't supported yet, for example, attributes
2391  // appertain to decl specifiers.
2392  void ProhibitCXX11Attributes(ParsedAttributesWithRange &Attrs,
2393                               unsigned DiagID);
2394
2395  /// Skip C++11 and C2x attributes and return the end location of the
2396  /// last one.
2397  /// \returns SourceLocation() if there are no attributes.
2398  SourceLocation SkipCXX11Attributes();
2399
2400  /// Diagnose and skip C++11 and C2x attributes that appear in syntactic
2401  /// locations where attributes are not allowed.
2402  void DiagnoseAndSkipCXX11Attributes();
2403
2404  /// Parses syntax-generic attribute arguments for attributes which are
2405  /// known to the implementation, and adds them to the given ParsedAttributes
2406  /// list with the given attribute syntax. Returns the number of arguments
2407  /// parsed for the attribute.
2408  unsigned
2409  ParseAttributeArgsCommon(IdentifierInfo *AttrNameSourceLocation AttrNameLoc,
2410                           ParsedAttributes &AttrsSourceLocation *EndLoc,
2411                           IdentifierInfo *ScopeNameSourceLocation ScopeLoc,
2412                           ParsedAttr::Syntax Syntax);
2413
2414  void MaybeParseGNUAttributes(Declarator &D,
2415                               LateParsedAttrList *LateAttrs = nullptr) {
2416    if (Tok.is(tok::kw___attribute)) {
2417      ParsedAttributes attrs(AttrFactory);
2418      SourceLocation endLoc;
2419      ParseGNUAttributes(attrs, &endLocLateAttrs, &D);
2420      D.takeAttributes(attrsendLoc);
2421    }
2422  }
2423  void MaybeParseGNUAttributes(ParsedAttributes &attrs,
2424                               SourceLocation *endLoc = nullptr,
2425                               LateParsedAttrList *LateAttrs = nullptr) {
2426    if (Tok.is(tok::kw___attribute))
2427      ParseGNUAttributes(attrsendLocLateAttrs);
2428  }
2429  void ParseGNUAttributes(ParsedAttributes &attrs,
2430                          SourceLocation *endLoc = nullptr,
2431                          LateParsedAttrList *LateAttrs = nullptr,
2432                          Declarator *D = nullptr);
2433  void ParseGNUAttributeArgs(IdentifierInfo *AttrName,
2434                             SourceLocation AttrNameLoc,
2435                             ParsedAttributes &AttrsSourceLocation *EndLoc,
2436                             IdentifierInfo *ScopeNameSourceLocation ScopeLoc,
2437                             ParsedAttr::Syntax SyntaxDeclarator *D);
2438  IdentifierLoc *ParseIdentifierLoc();
2439
2440  unsigned
2441  ParseClangAttributeArgs(IdentifierInfo *AttrNameSourceLocation AttrNameLoc,
2442                          ParsedAttributes &AttrsSourceLocation *EndLoc,
2443                          IdentifierInfo *ScopeNameSourceLocation ScopeLoc,
2444                          ParsedAttr::Syntax Syntax);
2445
2446  void MaybeParseCXX11Attributes(Declarator &D) {
2447    if (standardAttributesAllowed() && isCXX11AttributeSpecifier()) {
2448      ParsedAttributesWithRange attrs(AttrFactory);
2449      SourceLocation endLoc;
2450      ParseCXX11Attributes(attrs, &endLoc);
2451      D.takeAttributes(attrsendLoc);
2452    }
2453  }
2454  void MaybeParseCXX11Attributes(ParsedAttributes &attrs,
2455                                 SourceLocation *endLoc = nullptr) {
2456    if (standardAttributesAllowed() && isCXX11AttributeSpecifier()) {
2457      ParsedAttributesWithRange attrsWithRange(AttrFactory);
2458      ParseCXX11Attributes(attrsWithRangeendLoc);
2459      attrs.takeAllFrom(attrsWithRange);
2460    }
2461  }
2462  void MaybeParseCXX11Attributes(ParsedAttributesWithRange &attrs,
2463                                 SourceLocation *endLoc = nullptr,
2464                                 bool OuterMightBeMessageSend = false) {
2465    if (standardAttributesAllowed() &&
2466      isCXX11AttributeSpecifier(falseOuterMightBeMessageSend))
2467      ParseCXX11Attributes(attrsendLoc);
2468  }
2469
2470  void ParseCXX11AttributeSpecifier(ParsedAttributes &attrs,
2471                                    SourceLocation *EndLoc = nullptr);
2472  void ParseCXX11Attributes(ParsedAttributesWithRange &attrs,
2473                            SourceLocation *EndLoc = nullptr);
2474  /// Parses a C++11 (or C2x)-style attribute argument list. Returns true
2475  /// if this results in adding an attribute to the ParsedAttributes list.
2476  bool ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
2477                               SourceLocation AttrNameLoc,
2478                               ParsedAttributes &AttrsSourceLocation *EndLoc,
2479                               IdentifierInfo *ScopeName,
2480                               SourceLocation ScopeLoc);
2481
2482  IdentifierInfo *TryParseCXX11AttributeIdentifier(SourceLocation &Loc);
2483
2484  void MaybeParseMicrosoftAttributes(ParsedAttributes &attrs,
2485                                     SourceLocation *endLoc = nullptr) {
2486    if (getLangOpts().MicrosoftExt && Tok.is(tok::l_square))
2487      ParseMicrosoftAttributes(attrsendLoc);
2488  }
2489  void ParseMicrosoftUuidAttributeArgs(ParsedAttributes &Attrs);
2490  void ParseMicrosoftAttributes(ParsedAttributes &attrs,
2491                                SourceLocation *endLoc = nullptr);
2492  void MaybeParseMicrosoftDeclSpecs(ParsedAttributes &Attrs,
2493                                    SourceLocation *End = nullptr) {
2494    const auto &LO = getLangOpts();
2495    if (LO.DeclSpecKeyword && Tok.is(tok::kw___declspec))
2496      ParseMicrosoftDeclSpecs(AttrsEnd);
2497  }
2498  void ParseMicrosoftDeclSpecs(ParsedAttributes &Attrs,
2499                               SourceLocation *End = nullptr);
2500  bool ParseMicrosoftDeclSpecArgs(IdentifierInfo *AttrName,
2501                                  SourceLocation AttrNameLoc,
2502                                  ParsedAttributes &Attrs);
2503  void ParseMicrosoftTypeAttributes(ParsedAttributes &attrs);
2504  void DiagnoseAndSkipExtendedMicrosoftTypeAttributes();
2505  SourceLocation SkipExtendedMicrosoftTypeAttributes();
2506  void ParseMicrosoftInheritanceClassAttributes(ParsedAttributes &attrs);
2507  void ParseBorlandTypeAttributes(ParsedAttributes &attrs);
2508  void ParseOpenCLKernelAttributes(ParsedAttributes &attrs);
2509  void ParseOpenCLQualifiers(ParsedAttributes &Attrs);
2510  /// Parses opencl_unroll_hint attribute if language is OpenCL v2.0
2511  /// or higher.
2512  /// \return false if error happens.
2513  bool MaybeParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs) {
2514    if (getLangOpts().OpenCL)
2515      return ParseOpenCLUnrollHintAttribute(Attrs);
2516    return true;
2517  }
2518  /// Parses opencl_unroll_hint attribute.
2519  /// \return false if error happens.
2520  bool ParseOpenCLUnrollHintAttribute(ParsedAttributes &Attrs);
2521  void ParseNullabilityTypeSpecifiers(ParsedAttributes &attrs);
2522
2523  VersionTuple ParseVersionTuple(SourceRange &Range);
2524  void ParseAvailabilityAttribute(IdentifierInfo &Availability,
2525                                  SourceLocation AvailabilityLoc,
2526                                  ParsedAttributes &attrs,
2527                                  SourceLocation *endLoc,
2528                                  IdentifierInfo *ScopeName,
2529                                  SourceLocation ScopeLoc,
2530                                  ParsedAttr::Syntax Syntax);
2531
2532  Optional<AvailabilitySpecParseAvailabilitySpec();
2533  ExprResult ParseAvailabilityCheckExpr(SourceLocation StartLoc);
2534
2535  void ParseExternalSourceSymbolAttribute(IdentifierInfo &ExternalSourceSymbol,
2536                                          SourceLocation Loc,
2537                                          ParsedAttributes &Attrs,
2538                                          SourceLocation *EndLoc,
2539                                          IdentifierInfo *ScopeName,
2540                                          SourceLocation ScopeLoc,
2541                                          ParsedAttr::Syntax Syntax);
2542
2543  void ParseObjCBridgeRelatedAttribute(IdentifierInfo &ObjCBridgeRelated,
2544                                       SourceLocation ObjCBridgeRelatedLoc,
2545                                       ParsedAttributes &attrs,
2546                                       SourceLocation *endLoc,
2547                                       IdentifierInfo *ScopeName,
2548                                       SourceLocation ScopeLoc,
2549                                       ParsedAttr::Syntax Syntax);
2550
2551  void ParseTypeTagForDatatypeAttribute(IdentifierInfo &AttrName,
2552                                        SourceLocation AttrNameLoc,
2553                                        ParsedAttributes &Attrs,
2554                                        SourceLocation *EndLoc,
2555                                        IdentifierInfo *ScopeName,
2556                                        SourceLocation ScopeLoc,
2557                                        ParsedAttr::Syntax Syntax);
2558
2559  void
2560  ParseAttributeWithTypeArg(IdentifierInfo &AttrName,
2561                            SourceLocation AttrNameLocParsedAttributes &Attrs,
2562                            SourceLocation *EndLocIdentifierInfo *ScopeName,
2563                            SourceLocation ScopeLocParsedAttr::Syntax Syntax);
2564
2565  void ParseTypeofSpecifier(DeclSpec &DS);
2566  SourceLocation ParseDecltypeSpecifier(DeclSpec &DS);
2567  void AnnotateExistingDecltypeSpecifier(const DeclSpec &DS,
2568                                         SourceLocation StartLoc,
2569                                         SourceLocation EndLoc);
2570  void ParseUnderlyingTypeSpecifier(DeclSpec &DS);
2571  void ParseAtomicSpecifier(DeclSpec &DS);
2572
2573  ExprResult ParseAlignArgument(SourceLocation Start,
2574                                SourceLocation &EllipsisLoc);
2575  void ParseAlignmentSpecifier(ParsedAttributes &Attrs,
2576                               SourceLocation *endLoc = nullptr);
2577
2578  VirtSpecifiers::Specifier isCXX11VirtSpecifier(const Token &Tokconst;
2579  VirtSpecifiers::Specifier isCXX11VirtSpecifier() const {
2580    return isCXX11VirtSpecifier(Tok);
2581  }
2582  void ParseOptionalCXX11VirtSpecifierSeq(VirtSpecifiers &VSbool IsInterface,
2583                                          SourceLocation FriendLoc);
2584
2585  bool isCXX11FinalKeyword() const;
2586
2587  /// DeclaratorScopeObj - RAII object used in Parser::ParseDirectDeclarator to
2588  /// enter a new C++ declarator scope and exit it when the function is
2589  /// finished.
2590  class DeclaratorScopeObj {
2591    Parser &P;
2592    CXXScopeSpec &SS;
2593    bool EnteredScope;
2594    bool CreatedScope;
2595  public:
2596    DeclaratorScopeObj(Parser &pCXXScopeSpec &ss)
2597      : P(p), SS(ss), EnteredScope(false), CreatedScope(false) {}
2598
2599    void EnterDeclaratorScope() {
2600       (0) . __assert_fail ("!EnteredScope && \"Already entered the scope!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 2600, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!EnteredScope && "Already entered the scope!");
2601       (0) . __assert_fail ("SS.isSet() && \"C++ scope was not set!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 2601, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(SS.isSet() && "C++ scope was not set!");
2602
2603      CreatedScope = true;
2604      P.EnterScope(0); // Not a decl scope.
2605
2606      if (!P.Actions.ActOnCXXEnterDeclaratorScope(P.getCurScope(), SS))
2607        EnteredScope = true;
2608    }
2609
2610    ~DeclaratorScopeObj() {
2611      if (EnteredScope) {
2612         (0) . __assert_fail ("SS.isSet() && \"C++ scope was cleared ?\"", "/home/seafit/code_projects/clang_source/clang/include/clang/Parse/Parser.h", 2612, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(SS.isSet() && "C++ scope was cleared ?");
2613        P.Actions.ActOnCXXExitDeclaratorScope(P.getCurScope(), SS);
2614      }
2615      if (CreatedScope)
2616        P.ExitScope();
2617    }
2618  };
2619
2620  /// ParseDeclarator - Parse and verify a newly-initialized declarator.
2621  void ParseDeclarator(Declarator &D);
2622  /// A function that parses a variant of direct-declarator.
2623  typedef void (Parser::*DirectDeclParseFunction)(Declarator&);
2624  void ParseDeclaratorInternal(Declarator &D,
2625                               DirectDeclParseFunction DirectDeclParser);
2626
2627  enum AttrRequirements {
2628    AR_NoAttributesParsed = 0///< No attributes are diagnosed.
2629    AR_GNUAttributesParsedAndRejected = 1 << 0///< Diagnose GNU attributes.
2630    AR_GNUAttributesParsed = 1 << 1,
2631    AR_CXX11AttributesParsed = 1 << 2,
2632    AR_DeclspecAttributesParsed = 1 << 3,
2633    AR_AllAttributesParsed = AR_GNUAttributesParsed |
2634                             AR_CXX11AttributesParsed |
2635                             AR_DeclspecAttributesParsed,
2636    AR_VendorAttributesParsed = AR_GNUAttributesParsed |
2637                                AR_DeclspecAttributesParsed
2638  };
2639
2640  void ParseTypeQualifierListOpt(
2641      DeclSpec &DSunsigned AttrReqs = AR_AllAttributesParsed,
2642      bool AtomicAllowed = truebool IdentifierRequired = false,
2643      Optional<llvm::function_ref<void()>> CodeCompletionHandler = None);
2644  void ParseDirectDeclarator(Declarator &D);
2645  void ParseDecompositionDeclarator(Declarator &D);
2646  void ParseParenDeclarator(Declarator &D);
2647  void ParseFunctionDeclarator(Declarator &D,
2648                               ParsedAttributes &attrs,
2649                               BalancedDelimiterTracker &Tracker,
2650                               bool IsAmbiguous,
2651                               bool RequiresArg = false);
2652  bool ParseRefQualifier(bool &RefQualifierIsLValueRef,
2653                         SourceLocation &RefQualifierLoc);
2654  bool isFunctionDeclaratorIdentifierList();
2655  void ParseFunctionDeclaratorIdentifierList(
2656         Declarator &D,
2657         SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo);
2658  void ParseParameterDeclarationClause(
2659         Declarator &D,
2660         ParsedAttributes &attrs,
2661         SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo,
2662         SourceLocation &EllipsisLoc);
2663  void ParseBracketDeclarator(Declarator &D);
2664  void ParseMisplacedBracketDeclarator(Declarator &D);
2665
2666  //===--------------------------------------------------------------------===//
2667  // C++ 7: Declarations [dcl.dcl]
2668
2669  /// The kind of attribute specifier we have found.
2670  enum CXX11AttributeKind {
2671    /// This is not an attribute specifier.
2672    CAK_NotAttributeSpecifier,
2673    /// This should be treated as an attribute-specifier.
2674    CAK_AttributeSpecifier,
2675    /// The next tokens are '[[', but this is not an attribute-specifier. This
2676    /// is ill-formed by C++11 [dcl.attr.grammar]p6.
2677    CAK_InvalidAttributeSpecifier
2678  };
2679  CXX11AttributeKind
2680  isCXX11AttributeSpecifier(bool Disambiguate = false,
2681                            bool OuterMightBeMessageSend = false);
2682
2683  void DiagnoseUnexpectedNamespace(NamedDecl *Context);
2684
2685  DeclGroupPtrTy ParseNamespace(DeclaratorContext Context,
2686                                SourceLocation &DeclEnd,
2687                                SourceLocation InlineLoc = SourceLocation());
2688
2689  struct InnerNamespaceInfo {
2690    SourceLocation NamespaceLoc;
2691    SourceLocation InlineLoc;
2692    SourceLocation IdentLoc;
2693    IdentifierInfo *Ident;
2694  };
2695  using InnerNamespaceInfoList = llvm::SmallVector<InnerNamespaceInfo4>;
2696
2697  void ParseInnerNamespace(const InnerNamespaceInfoList &InnerNSs,
2698                           unsigned int indexSourceLocation &InlineLoc,
2699                           ParsedAttributes &attrs,
2700                           BalancedDelimiterTracker &Tracker);
2701  Decl *ParseLinkage(ParsingDeclSpec &DSDeclaratorContext Context);
2702  Decl *ParseExportDeclaration();
2703  DeclGroupPtrTy ParseUsingDirectiveOrDeclaration(
2704      DeclaratorContext Contextconst ParsedTemplateInfo &TemplateInfo,
2705      SourceLocation &DeclEndParsedAttributesWithRange &attrs);
2706  Decl *ParseUsingDirective(DeclaratorContext Context,
2707                            SourceLocation UsingLoc,
2708                            SourceLocation &DeclEnd,
2709                            ParsedAttributes &attrs);
2710
2711  struct UsingDeclarator {
2712    SourceLocation TypenameLoc;
2713    CXXScopeSpec SS;
2714    UnqualifiedId Name;
2715    SourceLocation EllipsisLoc;
2716
2717    void clear() {
2718      TypenameLoc = EllipsisLoc = SourceLocation();
2719      SS.clear();
2720      Name.clear();
2721    }
2722  };
2723
2724  bool ParseUsingDeclarator(DeclaratorContext ContextUsingDeclarator &D);
2725  DeclGroupPtrTy ParseUsingDeclaration(DeclaratorContext Context,
2726                                       const ParsedTemplateInfo &TemplateInfo,
2727                                       SourceLocation UsingLoc,
2728                                       SourceLocation &DeclEnd,
2729                                       AccessSpecifier AS = AS_none);
2730  Decl *ParseAliasDeclarationAfterDeclarator(
2731      const ParsedTemplateInfo &TemplateInfoSourceLocation UsingLoc,
2732      UsingDeclarator &DSourceLocation &DeclEndAccessSpecifier AS,
2733      ParsedAttributes &AttrsDecl **OwnedType = nullptr);
2734
2735  Decl *ParseStaticAssertDeclaration(SourceLocation &DeclEnd);
2736  Decl *ParseNamespaceAlias(SourceLocation NamespaceLoc,
2737                            SourceLocation AliasLocIdentifierInfo *Alias,
2738                            SourceLocation &DeclEnd);
2739
2740  //===--------------------------------------------------------------------===//
2741  // C++ 9: classes [class] and C structs/unions.
2742  bool isValidAfterTypeSpecifier(bool CouldBeBitfield);
2743  void ParseClassSpecifier(tok::TokenKind TagTokKindSourceLocation TagLoc,
2744                           DeclSpec &DSconst ParsedTemplateInfo &TemplateInfo,
2745                           AccessSpecifier ASbool EnteringContext,
2746                           DeclSpecContext DSC,
2747                           ParsedAttributesWithRange &Attributes);
2748  void SkipCXXMemberSpecification(SourceLocation StartLoc,
2749                                  SourceLocation AttrFixitLoc,
2750                                  unsigned TagType,
2751                                  Decl *TagDecl);
2752  void ParseCXXMemberSpecification(SourceLocation StartLoc,
2753                                   SourceLocation AttrFixitLoc,
2754                                   ParsedAttributesWithRange &Attrs,
2755                                   unsigned TagType,
2756                                   Decl *TagDecl);
2757  ExprResult ParseCXXMemberInitializer(Decl *Dbool IsFunction,
2758                                       SourceLocation &EqualLoc);
2759  bool ParseCXXMemberDeclaratorBeforeInitializer(Declarator &DeclaratorInfo,
2760                                                 VirtSpecifiers &VS,
2761                                                 ExprResult &BitfieldSize,
2762                                                 LateParsedAttrList &LateAttrs);
2763  void MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq(Declarator &D,
2764                                                               VirtSpecifiers &VS);
2765  DeclGroupPtrTy ParseCXXClassMemberDeclaration(
2766      AccessSpecifier ASParsedAttributes &Attr,
2767      const ParsedTemplateInfo &TemplateInfo = ParsedTemplateInfo(),
2768      ParsingDeclRAIIObject *DiagsFromTParams = nullptr);
2769  DeclGroupPtrTy ParseCXXClassMemberDeclarationWithPragmas(
2770      AccessSpecifier &ASParsedAttributesWithRange &AccessAttrs,
2771      DeclSpec::TST TagTypeDecl *Tag);
2772  void ParseConstructorInitializer(Decl *ConstructorDecl);
2773  MemInitResult ParseMemInitializer(Decl *ConstructorDecl);
2774  void HandleMemberFunctionDeclDelays(DeclaratorDeclaratorInfo,
2775                                      Decl *ThisDecl);
2776
2777  //===--------------------------------------------------------------------===//
2778  // C++ 10: Derived classes [class.derived]
2779  TypeResult ParseBaseTypeSpecifier(SourceLocation &BaseLoc,
2780                                    SourceLocation &EndLocation);
2781  void ParseBaseClause(Decl *ClassDecl);
2782  BaseResult ParseBaseSpecifier(Decl *ClassDecl);
2783  AccessSpecifier getAccessSpecifierIfPresent() const;
2784
2785  bool ParseUnqualifiedIdTemplateId(CXXScopeSpec &SS,
2786                                    SourceLocation TemplateKWLoc,
2787                                    IdentifierInfo *Name,
2788                                    SourceLocation NameLoc,
2789                                    bool EnteringContext,
2790                                    ParsedType ObjectType,
2791                                    UnqualifiedId &Id,
2792                                    bool AssumeTemplateId);
2793  bool ParseUnqualifiedIdOperator(CXXScopeSpec &SSbool EnteringContext,
2794                                  ParsedType ObjectType,
2795                                  UnqualifiedId &Result);
2796
2797  //===--------------------------------------------------------------------===//
2798  // OpenMP: Directives and clauses.
2799  /// Parse clauses for '#pragma omp declare simd'.
2800  DeclGroupPtrTy ParseOMPDeclareSimdClauses(DeclGroupPtrTy Ptr,
2801                                            CachedTokens &Toks,
2802                                            SourceLocation Loc);
2803  /// Parse clauses for '#pragma omp declare target'.
2804  DeclGroupPtrTy ParseOMPDeclareTargetClauses();
2805  /// Parse '#pragma omp end declare target'.
2806  void ParseOMPEndDeclareTargetDirective(OpenMPDirectiveKind DKind,
2807                                         SourceLocation Loc);
2808  /// Parses declarative OpenMP directives.
2809  DeclGroupPtrTy ParseOpenMPDeclarativeDirectiveWithExtDecl(
2810      AccessSpecifier &ASParsedAttributesWithRange &Attrs,
2811      DeclSpec::TST TagType = DeclSpec::TST_unspecified,
2812      Decl *TagDecl = nullptr);
2813  /// Parse 'omp declare reduction' construct.
2814  DeclGroupPtrTy ParseOpenMPDeclareReductionDirective(AccessSpecifier AS);
2815  /// Parses initializer for provided omp_priv declaration inside the reduction
2816  /// initializer.
2817  void ParseOpenMPReductionInitializerForDecl(VarDecl *OmpPrivParm);
2818
2819  /// Parses 'omp declare mapper' directive.
2820  DeclGroupPtrTy ParseOpenMPDeclareMapperDirective(AccessSpecifier AS);
2821  /// Parses variable declaration in 'omp declare mapper' directive.
2822  TypeResult parseOpenMPDeclareMapperVarDecl(SourceRange &Range,
2823                                             DeclarationName &Name,
2824                                             AccessSpecifier AS = AS_none);
2825
2826  /// Parses simple list of variables.
2827  ///
2828  /// \param Kind Kind of the directive.
2829  /// \param Callback Callback function to be called for the list elements.
2830  /// \param AllowScopeSpecifier true, if the variables can have fully
2831  /// qualified names.
2832  ///
2833  bool ParseOpenMPSimpleVarList(
2834      OpenMPDirectiveKind Kind,
2835      const llvm::function_ref<void(CXXScopeSpec &, DeclarationNameInfo)> &
2836          Callback,
2837      bool AllowScopeSpecifier);
2838  /// Parses declarative or executable directive.
2839  ///
2840  /// \param StmtCtx The context in which we're parsing the directive.
2841  StmtResult
2842  ParseOpenMPDeclarativeOrExecutableDirective(ParsedStmtContext StmtCtx);
2843  /// Parses clause of kind \a CKind for directive of a kind \a Kind.
2844  ///
2845  /// \param DKind Kind of current directive.
2846  /// \param CKind Kind of current clause.
2847  /// \param FirstClause true, if this is the first clause of a kind \a CKind
2848  /// in current directive.
2849  ///
2850  OMPClause *ParseOpenMPClause(OpenMPDirectiveKind DKind,
2851                               OpenMPClauseKind CKindbool FirstClause);
2852  /// Parses clause with a single expression of a kind \a Kind.
2853  ///
2854  /// \param Kind Kind of current clause.
2855  /// \param ParseOnly true to skip the clause's semantic actions and return
2856  /// nullptr.
2857  ///
2858  OMPClause *ParseOpenMPSingleExprClause(OpenMPClauseKind Kind,
2859                                         bool ParseOnly);
2860  /// Parses simple clause of a kind \a Kind.
2861  ///
2862  /// \param Kind Kind of current clause.
2863  /// \param ParseOnly true to skip the clause's semantic actions and return
2864  /// nullptr.
2865  ///
2866  OMPClause *ParseOpenMPSimpleClause(OpenMPClauseKind Kindbool ParseOnly);
2867  /// Parses clause with a single expression and an additional argument
2868  /// of a kind \a Kind.
2869  ///
2870  /// \param Kind Kind of current clause.
2871  /// \param ParseOnly true to skip the clause's semantic actions and return
2872  /// nullptr.
2873  ///
2874  OMPClause *ParseOpenMPSingleExprWithArgClause(OpenMPClauseKind Kind,
2875                                                bool ParseOnly);
2876  /// Parses clause without any additional arguments.
2877  ///
2878  /// \param Kind Kind of current clause.
2879  /// \param ParseOnly true to skip the clause's semantic actions and return
2880  /// nullptr.
2881  ///
2882  OMPClause *ParseOpenMPClause(OpenMPClauseKind Kindbool ParseOnly = false);
2883  /// Parses clause with the list of variables of a kind \a Kind.
2884  ///
2885  /// \param Kind Kind of current clause.
2886  /// \param ParseOnly true to skip the clause's semantic actions and return
2887  /// nullptr.
2888  ///
2889  OMPClause *ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
2890                                      OpenMPClauseKind Kindbool ParseOnly);
2891
2892public:
2893  /// Parses simple expression in parens for single-expression clauses of OpenMP
2894  /// constructs.
2895  /// \param RLoc Returned location of right paren.
2896  ExprResult ParseOpenMPParensExpr(StringRef ClauseNameSourceLocation &RLoc);
2897
2898  /// Data used for parsing list of variables in OpenMP clauses.
2899  struct OpenMPVarListDataTy {
2900    Expr *TailExpr = nullptr;
2901    SourceLocation ColonLoc;
2902    SourceLocation RLoc;
2903    CXXScopeSpec ReductionOrMapperIdScopeSpec;
2904    DeclarationNameInfo ReductionOrMapperId;
2905    OpenMPDependClauseKind DepKind = OMPC_DEPEND_unknown;
2906    OpenMPLinearClauseKind LinKind = OMPC_LINEAR_val;
2907    SmallVector<OpenMPMapModifierKindOMPMapClause::NumberOfModifiers>
2908    MapTypeModifiers;
2909    SmallVector<SourceLocationOMPMapClause::NumberOfModifiers>
2910    MapTypeModifiersLoc;
2911    OpenMPMapClauseKind MapType = OMPC_MAP_unknown;
2912    bool IsMapTypeImplicit = false;
2913    SourceLocation DepLinMapLoc;
2914  };
2915
2916  /// Parses clauses with list.
2917  bool ParseOpenMPVarList(OpenMPDirectiveKind DKindOpenMPClauseKind Kind,
2918                          SmallVectorImpl<Expr *> &Vars,
2919                          OpenMPVarListDataTy &Data);
2920  bool ParseUnqualifiedId(CXXScopeSpec &SSbool EnteringContext,
2921                          bool AllowDestructorName,
2922                          bool AllowConstructorName,
2923                          bool AllowDeductionGuide,
2924                          ParsedType ObjectType,
2925                          SourceLocation *TemplateKWLoc,
2926                          UnqualifiedId &Result);
2927  /// Parses the mapper modifier in map, to, and from clauses.
2928  bool parseMapperModifier(OpenMPVarListDataTy &Data);
2929  /// Parses map-type-modifiers in map clause.
2930  /// map([ [map-type-modifier[,] [map-type-modifier[,] ...] map-type : ] list)
2931  /// where, map-type-modifier ::= always | close | mapper(mapper-identifier)
2932  bool parseMapTypeModifiers(OpenMPVarListDataTy &Data);
2933
2934private:
2935  //===--------------------------------------------------------------------===//
2936  // C++ 14: Templates [temp]
2937
2938  // C++ 14.1: Template Parameters [temp.param]
2939  Decl *ParseDeclarationStartingWithTemplate(DeclaratorContext Context,
2940                                             SourceLocation &DeclEnd,
2941                                             ParsedAttributes &AccessAttrs,
2942                                             AccessSpecifier AS = AS_none);
2943  Decl *ParseTemplateDeclarationOrSpecialization(DeclaratorContext Context,
2944                                                 SourceLocation &DeclEnd,
2945                                                 ParsedAttributes &AccessAttrs,
2946                                                 AccessSpecifier AS);
2947  Decl *ParseSingleDeclarationAfterTemplate(
2948      DeclaratorContext Contextconst ParsedTemplateInfo &TemplateInfo,
2949      ParsingDeclRAIIObject &DiagsFromParamsSourceLocation &DeclEnd,
2950      ParsedAttributes &AccessAttrsAccessSpecifier AS = AS_none);
2951  bool ParseTemplateParameters(unsigned Depth,
2952                               SmallVectorImpl<NamedDecl *> &TemplateParams,
2953                               SourceLocation &LAngleLoc,
2954                               SourceLocation &RAngleLoc);
2955  bool ParseTemplateParameterList(unsigned Depth,
2956                                  SmallVectorImpl<NamedDecl*> &TemplateParams);
2957  bool isStartOfTemplateTypeParameter();
2958  NamedDecl *ParseTemplateParameter(unsigned Depthunsigned Position);
2959  NamedDecl *ParseTypeParameter(unsigned Depthunsigned Position);
2960  NamedDecl *ParseTemplateTemplateParameter(unsigned Depthunsigned Position);
2961  NamedDecl *ParseNonTypeTemplateParameter(unsigned Depthunsigned Position);
2962  void DiagnoseMisplacedEllipsis(SourceLocation EllipsisLoc,
2963                                 SourceLocation CorrectLoc,
2964                                 bool AlreadyHasEllipsis,
2965                                 bool IdentifierHasName);
2966  void DiagnoseMisplacedEllipsisInDeclarator(SourceLocation EllipsisLoc,
2967                                             Declarator &D);
2968  // C++ 14.3: Template arguments [temp.arg]
2969  typedef SmallVector<ParsedTemplateArgument16TemplateArgList;
2970
2971  bool ParseGreaterThanInTemplateList(SourceLocation &RAngleLoc,
2972                                      bool ConsumeLastToken,
2973                                      bool ObjCGenericList);
2974  bool ParseTemplateIdAfterTemplateName(bool ConsumeLastToken,
2975                                        SourceLocation &LAngleLoc,
2976                                        TemplateArgList &TemplateArgs,
2977                                        SourceLocation &RAngleLoc);
2978
2979  bool AnnotateTemplateIdToken(TemplateTy TemplateTemplateNameKind TNK,
2980                               CXXScopeSpec &SS,
2981                               SourceLocation TemplateKWLoc,
2982                               UnqualifiedId &TemplateName,
2983                               bool AllowTypeAnnotation = true);
2984  void AnnotateTemplateIdTokenAsType(bool IsClassName = false);
2985  bool IsTemplateArgumentList(unsigned Skip = 0);
2986  bool ParseTemplateArgumentList(TemplateArgList &TemplateArgs);
2987  ParsedTemplateArgument ParseTemplateTemplateArgument();
2988  ParsedTemplateArgument ParseTemplateArgument();
2989  Decl *ParseExplicitInstantiation(DeclaratorContext Context,
2990                                   SourceLocation ExternLoc,
2991                                   SourceLocation TemplateLoc,
2992                                   SourceLocation &DeclEnd,
2993                                   ParsedAttributes &AccessAttrs,
2994                                   AccessSpecifier AS = AS_none);
2995
2996  //===--------------------------------------------------------------------===//
2997  // Modules
2998  DeclGroupPtrTy ParseModuleDecl();
2999  Decl *ParseModuleImport(SourceLocation AtLoc);
3000  bool parseMisplacedModuleImport();
3001  bool tryParseMisplacedModuleImport() {
3002    tok::TokenKind Kind = Tok.getKind();
3003    if (Kind == tok::annot_module_begin || Kind == tok::annot_module_end ||
3004        Kind == tok::annot_module_include)
3005      return parseMisplacedModuleImport();
3006    return false;
3007  }
3008
3009  bool ParseModuleName(
3010      SourceLocation UseLoc,
3011      SmallVectorImpl<std::pair<IdentifierInfo *, SourceLocation>> &Path,
3012      bool IsImport);
3013
3014  //===--------------------------------------------------------------------===//
3015  // C++11/G++: Type Traits [Type-Traits.html in the GCC manual]
3016  ExprResult ParseTypeTrait();
3017
3018  //===--------------------------------------------------------------------===//
3019  // Embarcadero: Arary and Expression Traits
3020  ExprResult ParseArrayTypeTrait();
3021  ExprResult ParseExpressionTrait();
3022
3023  //===--------------------------------------------------------------------===//
3024  // Preprocessor code-completion pass-through
3025  void CodeCompleteDirective(bool InConditional) override;
3026  void CodeCompleteInConditionalExclusion() override;
3027  void CodeCompleteMacroName(bool IsDefinition) override;
3028  void CodeCompletePreprocessorExpression() override;
3029  void CodeCompleteMacroArgument(IdentifierInfo *MacroMacroInfo *MacroInfo,
3030                                 unsigned ArgumentIndex) override;
3031  void CodeCompleteIncludedFile(llvm::StringRef Dirbool IsAngled) override;
3032  void CodeCompleteNaturalLanguage() override;
3033};
3034
3035}  // end namespace clang
3036
3037#endif
3038
clang::Parser::PP
clang::Parser::Tok
clang::Parser::PrevTokLocation
clang::Parser::PreferredType
clang::Parser::ParenCount
clang::Parser::BracketCount
clang::Parser::BraceCount
clang::Parser::MisplacedModuleBeginCount
clang::Parser::Actions
clang::Parser::Diags
clang::Parser::NumCachedScopes
clang::Parser::ScopeCache
clang::Parser::Ident__exception_code
clang::Parser::Ident___exception_code
clang::Parser::Ident_GetExceptionCode
clang::Parser::Ident__exception_info
clang::Parser::Ident___exception_info
clang::Parser::Ident_GetExceptionInfo
clang::Parser::Ident__abnormal_termination
clang::Parser::Ident___abnormal_termination
clang::Parser::Ident_AbnormalTermination
clang::Parser::Ident__except
clang::Parser::Ident_sealed
clang::Parser::Ident_super
clang::Parser::Ident_vector
clang::Parser::Ident_bool
clang::Parser::Ident_pixel
clang::Parser::Ident_instancetype
clang::Parser::Ident_introduced
clang::Parser::Ident_deprecated
clang::Parser::Ident_obsoleted
clang::Parser::Ident_unavailable
clang::Parser::Ident_message
clang::Parser::Ident_strict
clang::Parser::Ident_replacement
clang::Parser::Ident_language
clang::Parser::Ident_defined_in
clang::Parser::Ident_generated_declaration
clang::Parser::Ident_final
clang::Parser::Ident_GNU_final
clang::Parser::Ident_override
clang::Parser::RevertibleTypeTraits
clang::Parser::AlignHandler
clang::Parser::GCCVisibilityHandler
clang::Parser::OptionsHandler
clang::Parser::PackHandler
clang::Parser::MSStructHandler
clang::Parser::UnusedHandler
clang::Parser::WeakHandler
clang::Parser::RedefineExtnameHandler
clang::Parser::FPContractHandler
clang::Parser::OpenCLExtensionHandler
clang::Parser::OpenMPHandler
clang::Parser::PCSectionHandler
clang::Parser::MSCommentHandler
clang::Parser::MSDetectMismatchHandler
clang::Parser::MSPointersToMembers
clang::Parser::MSVtorDisp
clang::Parser::MSInitSeg
clang::Parser::MSDataSeg
clang::Parser::MSBSSSeg
clang::Parser::MSConstSeg
clang::Parser::MSCodeSeg
clang::Parser::MSSection
clang::Parser::MSRuntimeChecks
clang::Parser::MSIntrinsic
clang::Parser::MSOptimize
clang::Parser::CUDAForceHostDeviceHandler
clang::Parser::OptimizeHandler
clang::Parser::LoopHintHandler
clang::Parser::UnrollHintHandler
clang::Parser::NoUnrollHintHandler
clang::Parser::UnrollAndJamHintHandler
clang::Parser::NoUnrollAndJamHintHandler
clang::Parser::FPHandler
clang::Parser::STDCFENVHandler
clang::Parser::STDCCXLIMITHandler
clang::Parser::STDCUnknownHandler
clang::Parser::AttributePragmaHandler
clang::Parser::CommentSemaHandler
clang::Parser::GreaterThanIsOperator
clang::Parser::ColonIsSacred
clang::Parser::InMessageExpression
clang::Parser::CalledSignatureHelp
clang::Parser::TemplateParameterDepth
clang::Parser::TemplateParameterDepthRAII
clang::Parser::TemplateParameterDepthRAII::Depth
clang::Parser::TemplateParameterDepthRAII::AddedLevels
clang::Parser::TemplateParameterDepthRAII::addDepth
clang::Parser::TemplateParameterDepthRAII::getDepth
clang::Parser::AttrFactory
clang::Parser::TemplateIds
clang::Parser::TentativelyDeclaredIdentifiers
clang::Parser::AngleBracketTracker
clang::Parser::AngleBracketTracker::Priority
clang::Parser::AngleBracketTracker::Loc
clang::Parser::AngleBracketTracker::Loc::TemplateName
clang::Parser::AngleBracketTracker::Loc::LessLoc
clang::Parser::AngleBracketTracker::Loc::Priority
clang::Parser::AngleBracketTracker::Loc::ParenCount
clang::Parser::AngleBracketTracker::Loc::BracketCount
clang::Parser::AngleBracketTracker::Loc::BraceCount
clang::Parser::AngleBracketTracker::Loc::isActive
clang::Parser::AngleBracketTracker::Loc::isActiveOrNested
clang::Parser::AngleBracketTracker::Locs
clang::Parser::AngleBracketTracker::add
clang::Parser::AngleBracketTracker::clear
clang::Parser::AngleBracketTracker::getCurrent
clang::Parser::AngleBrackets
clang::Parser::getSEHExceptKeyword
clang::Parser::ParsingInObjCContainer
clang::Parser::SkipFunctionBodies
clang::Parser::ExprStatementTokLoc
clang::Parser::ParsedStmtContext
clang::Parser::handleExprStmt
clang::Parser::getLangOpts
clang::Parser::getTargetInfo
clang::Parser::getPreprocessor
clang::Parser::getActions
clang::Parser::getAttrFactory
clang::Parser::getCurToken
clang::Parser::getCurScope
clang::Parser::incrementMSManglingNumber
clang::Parser::getObjCDeclContext
clang::Parser::Initialize
clang::Parser::ParseFirstTopLevelDecl
clang::Parser::ParseTopLevelDecl
clang::Parser::ParseTopLevelDecl
clang::Parser::ConsumeToken
clang::Parser::TryConsumeToken
clang::Parser::TryConsumeToken
clang::Parser::ConsumeAnyToken
clang::Parser::getEndOfPreviousToken
clang::Parser::getNullabilityKeyword
clang::Parser::isTokenParen
clang::Parser::isTokenBracket
clang::Parser::isTokenBrace
clang::Parser::isTokenStringLiteral
clang::Parser::isTokenSpecial
clang::Parser::isTokenEqualOrEqualTypo
clang::Parser::UnconsumeToken
clang::Parser::ConsumeAnnotationToken
clang::Parser::ConsumeParen
clang::Parser::ConsumeBracket
clang::Parser::ConsumeBrace
clang::Parser::ConsumeStringToken
clang::Parser::ConsumeCodeCompletionToken
clang::Parser::handleUnexpectedCodeCompletionToken
clang::Parser::cutOffParsing
clang::Parser::isEofOrEom
clang::Parser::isFoldOperator
clang::Parser::isFoldOperator
clang::Parser::initializePragmaHandlers
clang::Parser::resetPragmaHandlers
clang::Parser::HandlePragmaUnused
clang::Parser::HandlePragmaVisibility
clang::Parser::HandlePragmaPack
clang::Parser::HandlePragmaMSStruct
clang::Parser::HandlePragmaMSComment
clang::Parser::HandlePragmaMSPointersToMembers
clang::Parser::HandlePragmaMSVtorDisp
clang::Parser::HandlePragmaMSPragma
clang::Parser::HandlePragmaMSSection
clang::Parser::HandlePragmaMSSegment
clang::Parser::HandlePragmaMSInitSeg
clang::Parser::HandlePragmaAlign
clang::Parser::HandlePragmaDump
clang::Parser::HandlePragmaWeak
clang::Parser::HandlePragmaWeakAlias
clang::Parser::HandlePragmaRedefineExtname
clang::Parser::HandlePragmaFPContract
clang::Parser::HandlePragmaFEnvAccess
clang::Parser::HandlePragmaFP
clang::Parser::HandlePragmaOpenCLExtension
clang::Parser::HandlePragmaCaptured
clang::Parser::HandlePragmaLoopHint
clang::Parser::ParsePragmaAttributeSubjectMatchRuleSet
clang::Parser::HandlePragmaAttribute
clang::Parser::GetLookAheadToken
clang::Parser::NextToken
clang::Parser::getTypeAnnotation
clang::Parser::setTypeAnnotation
clang::Parser::getExprAnnotation
clang::Parser::setExprAnnotation
clang::Parser::TryAnnotateTypeOrScopeToken
clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec
clang::Parser::TryAnnotateCXXScopeToken
clang::Parser::AnnotatedNameKind
clang::Parser::TryAnnotateName
clang::Parser::AnnotateScopeToken
clang::Parser::TryAltiVecToken
clang::Parser::TryAltiVecVectorToken
clang::Parser::TryAltiVecVectorTokenOutOfLine
clang::Parser::TryAltiVecTokenOutOfLine
clang::Parser::isObjCInstancetype
clang::Parser::TryKeywordIdentFallback
clang::Parser::takeTemplateIdAnnotation
clang::Parser::TentativeParsingAction
clang::Parser::TentativeParsingAction::P
clang::Parser::TentativeParsingAction::PrevPreferredType
clang::Parser::TentativeParsingAction::PrevTok
clang::Parser::TentativeParsingAction::PrevTentativelyDeclaredIdentifierCount
clang::Parser::TentativeParsingAction::PrevParenCount
clang::Parser::TentativeParsingAction::PrevBracketCount
clang::Parser::TentativeParsingAction::PrevBraceCount
clang::Parser::TentativeParsingAction::isActive
clang::Parser::TentativeParsingAction::Commit
clang::Parser::TentativeParsingAction::Revert
clang::Parser::RevertingTentativeParsingAction
clang::Parser::ObjCDeclContextSwitch
clang::Parser::ObjCDeclContextSwitch::P
clang::Parser::ObjCDeclContextSwitch::DC
clang::Parser::ObjCDeclContextSwitch::WithinObjCContainer
clang::Parser::ExpectAndConsume
clang::Parser::ExpectAndConsumeSemi
clang::Parser::ExtraSemiKind
clang::Parser::ConsumeExtraSemi
clang::Parser::expectIdentifier
clang::Parser::ParseScope
clang::Parser::ParseScope::Self
clang::Parser::ParseScope::Exit
clang::Parser::EnterScope
clang::Parser::ExitScope
clang::Parser::ParseScopeFlags
clang::Parser::ParseScopeFlags::CurScope
clang::Parser::ParseScopeFlags::OldFlags
clang::Parser::Diag
clang::Parser::Diag
clang::Parser::Diag
clang::Parser::SuggestParentheses
clang::Parser::CheckNestedObjCContexts
clang::Parser::SkipUntilFlags
clang::Parser::SkipUntil
clang::Parser::SkipUntil
clang::Parser::SkipUntil
clang::Parser::SkipUntil
clang::Parser::SkipMalformedDecl
clang::Parser::LateParsedDeclaration
clang::Parser::LateParsedDeclaration::ParseLexedMethodDeclarations
clang::Parser::LateParsedDeclaration::ParseLexedMemberInitializers
clang::Parser::LateParsedDeclaration::ParseLexedMethodDefs
clang::Parser::LateParsedDeclaration::ParseLexedAttributes
clang::Parser::LateParsedClass
clang::Parser::LateParsedClass::ParseLexedMethodDeclarations
clang::Parser::LateParsedClass::ParseLexedMemberInitializers
clang::Parser::LateParsedClass::ParseLexedMethodDefs
clang::Parser::LateParsedClass::ParseLexedAttributes
clang::Parser::LateParsedClass::Self
clang::Parser::LateParsedClass::Class
clang::Parser::LateParsedAttribute
clang::Parser::LateParsedAttribute::Self
clang::Parser::LateParsedAttribute::Toks
clang::Parser::LateParsedAttribute::AttrName
clang::Parser::LateParsedAttribute::AttrNameLoc
clang::Parser::LateParsedAttribute::Decls
clang::Parser::LateParsedAttribute::ParseLexedAttributes
clang::Parser::LateParsedAttribute::addDecl
clang::Parser::LateParsedAttrList
clang::Parser::LateParsedAttrList::parseSoon
clang::Parser::LateParsedAttrList::ParseSoon
clang::Parser::LexedMethod
clang::Parser::LexedMethod::Self
clang::Parser::LexedMethod::D
clang::Parser::LexedMethod::Toks
clang::Parser::LexedMethod::TemplateScope
clang::Parser::LexedMethod::ParseLexedMethodDefs
clang::Parser::LateParsedDefaultArgument
clang::Parser::LateParsedDefaultArgument::Param
clang::Parser::LateParsedDefaultArgument::Toks
clang::Parser::LateParsedMethodDeclaration
clang::Parser::LateParsedMethodDeclaration::ParseLexedMethodDeclarations
clang::Parser::LateParsedMethodDeclaration::Self
clang::Parser::LateParsedMethodDeclaration::Method
clang::Parser::LateParsedMethodDeclaration::TemplateScope
clang::Parser::LateParsedMethodDeclaration::DefaultArgs
clang::Parser::LateParsedMethodDeclaration::ExceptionSpecTokens
clang::Parser::LateParsedMemberInitializer
clang::Parser::LateParsedMemberInitializer::ParseLexedMemberInitializers
clang::Parser::LateParsedMemberInitializer::Self
clang::Parser::LateParsedMemberInitializer::Field
clang::Parser::LateParsedMemberInitializer::Toks
clang::Parser::ParsingClass
clang::Parser::ParsingClass::TopLevelClass
clang::Parser::ParsingClass::TemplateScope
clang::Parser::ParsingClass::IsInterface
clang::Parser::ParsingClass::TagOrTemplate
clang::Parser::ParsingClass::LateParsedDeclarations
clang::Parser::ClassStack
clang::Parser::getCurrentClass
clang::Parser::ParsingClassDefinition
clang::Parser::ParsingClassDefinition::P
clang::Parser::ParsingClassDefinition::Popped
clang::Parser::ParsingClassDefinition::State
clang::Parser::ParsingClassDefinition::Pop
clang::Parser::ParsedTemplateInfo
clang::Parser::ParsedTemplateInfo::Kind
clang::Parser::ParsedTemplateInfo::TemplateParams
clang::Parser::ParsedTemplateInfo::ExternLoc
clang::Parser::ParsedTemplateInfo::TemplateLoc
clang::Parser::ParsedTemplateInfo::LastParameterListWasEmpty
clang::Parser::ParsedTemplateInfo::getSourceRange
clang::Parser::LexTemplateFunctionForLateParsing
clang::Parser::ParseLateTemplatedFuncDef
clang::Parser::LateTemplateParserCallback
clang::Parser::LateTemplateParserCleanupCallback
clang::Parser::PushParsingClass
clang::Parser::DeallocateParsedClasses
clang::Parser::PopParsingClass
clang::Parser::CachedInitKind
clang::Parser::ParseCXXInlineMethodDef
clang::Parser::ParseCXXNonStaticMemberInitializer
clang::Parser::ParseLexedAttributes
clang::Parser::ParseLexedAttributeList
clang::Parser::ParseLexedAttribute
clang::Parser::ParseLexedMethodDeclarations
clang::Parser::ParseLexedMethodDeclaration
clang::Parser::ParseLexedMethodDefs
clang::Parser::ParseLexedMethodDef
clang::Parser::ParseLexedMemberInitializers
clang::Parser::ParseLexedMemberInitializer
clang::Parser::ParseLexedObjCMethodDefs
clang::Parser::ConsumeAndStoreFunctionPrologue
clang::Parser::ConsumeAndStoreInitializer
clang::Parser::ConsumeAndStoreConditional
clang::Parser::ConsumeAndStoreUntil
clang::Parser::ConsumeAndStoreUntil
clang::Parser::ParsedAttributesWithRange
clang::Parser::ParsedAttributesWithRange::clear
clang::Parser::ParsedAttributesWithRange::Range
clang::Parser::ParsedAttributesViewWithRange
clang::Parser::ParsedAttributesViewWithRange::clearListOnly
clang::Parser::ParsedAttributesViewWithRange::Range
clang::Parser::ParseExternalDeclaration
clang::Parser::isDeclarationAfterDeclarator
clang::Parser::isStartOfFunctionDefinition
clang::Parser::ParseDeclarationOrFunctionDefinition
clang::Parser::ParseDeclOrFunctionDefInternal
clang::Parser::SkipFunctionBody
clang::Parser::ParseFunctionDefinition
clang::Parser::ParseKNRParamDeclarations
clang::Parser::ParseSimpleAsm
clang::Parser::ParseAsmStringLiteral
clang::Parser::MaybeSkipAttributes
clang::Parser::ParseObjCAtDirectives
clang::Parser::ParseObjCAtClassDeclaration
clang::Parser::ParseObjCAtInterfaceDeclaration
clang::Parser::parseObjCTypeParamList
clang::Parser::parseObjCTypeParamListOrProtocolRefs
clang::Parser::HelperActionsForIvarDeclarations
clang::Parser::ParseObjCClassInstanceVariables
clang::Parser::ParseObjCProtocolReferences
clang::Parser::parseObjCTypeArgsOrProtocolQualifiers
clang::Parser::parseObjCTypeArgsAndProtocolQualifiers
clang::Parser::parseObjCProtocolQualifierType
clang::Parser::parseObjCTypeArgsAndProtocolQualifiers
clang::Parser::ParseObjCInterfaceDeclList
clang::Parser::ParseObjCAtProtocolDeclaration
clang::Parser::ObjCImplParsingDataRAII
clang::Parser::ObjCImplParsingDataRAII::P
clang::Parser::ObjCImplParsingDataRAII::Dcl
clang::Parser::ObjCImplParsingDataRAII::HasCFunction
clang::Parser::ObjCImplParsingDataRAII::LateParsedObjCMethods
clang::Parser::ObjCImplParsingDataRAII::finish
clang::Parser::ObjCImplParsingDataRAII::isFinished
clang::Parser::ObjCImplParsingDataRAII::Finished
clang::Parser::CurParsedObjCImpl
clang::Parser::StashAwayMethodOrFunctionBodyTokens
clang::Parser::ParseObjCAtImplementationDeclaration
clang::Parser::ParseObjCAtEndDeclaration
clang::Parser::ParseObjCAtAliasDeclaration
clang::Parser::ParseObjCPropertySynthesize
clang::Parser::ParseObjCPropertyDynamic
clang::Parser::ParseObjCSelectorPiece
clang::Parser::ObjCTypeQual
clang::Parser::ObjCTypeQuals
clang::Parser::isTokIdentifier_in
clang::Parser::ParseObjCTypeName
clang::Parser::ParseObjCMethodRequirement
clang::Parser::ParseObjCMethodPrototype
clang::Parser::ParseObjCMethodDecl
clang::Parser::ParseObjCPropertyAttribute
clang::Parser::ParseObjCMethodDefinition
clang::Parser::TypeCastState
clang::Parser::ParseExpression
clang::Parser::ParseConstantExpressionInExprEvalContext
clang::Parser::ParseConstantExpression
clang::Parser::ParseCaseExpression
clang::Parser::ParseConstraintExpression
clang::Parser::ParseAssignmentExpression
clang::Parser::ParseMSAsmIdentifier
clang::Parser::ParseExpressionWithLeadingAt
clang::Parser::ParseExpressionWithLeadingExtension
clang::Parser::ParseRHSOfBinaryExpression
clang::Parser::ParseCastExpression
clang::Parser::ParseCastExpression
clang::Parser::isNotExpressionStart
clang::Parser::isPostfixExpressionSuffixStart
clang::Parser::diagnoseUnknownTemplateId
clang::Parser::checkPotentialAngleBracket
clang::Parser::checkPotentialAngleBracketDelimiter
clang::Parser::checkPotentialAngleBracketDelimiter
clang::Parser::ParsePostfixExpressionSuffix
clang::Parser::ParseUnaryExprOrTypeTraitExpression
clang::Parser::ParseBuiltinPrimaryExpression
clang::Parser::ParseExprAfterUnaryExprOrTypeTrait
clang::Parser::ParseExpressionList
clang::Parser::ParseSimpleExpressionList
clang::Parser::ParenParseOption
clang::Parser::ParseParenExpression
clang::Parser::ParseCXXAmbiguousParenExpression
clang::Parser::ParseCompoundLiteralExpression
clang::Parser::ParseStringLiteralExpression
clang::Parser::ParseGenericSelectionExpression
clang::Parser::ParseObjCBoolLiteral
clang::Parser::ParseFoldExpression
clang::Parser::tryParseCXXIdExpression
clang::Parser::ParseCXXIdExpression
clang::Parser::areTokensAdjacent
clang::Parser::CheckForTemplateAndDigraph
clang::Parser::ParseOptionalCXXScopeSpecifier
clang::Parser::ParseLambdaExpression
clang::Parser::TryParseLambdaExpression
clang::Parser::ParseLambdaIntroducer
clang::Parser::TryParseLambdaIntroducer
clang::Parser::ParseLambdaExpressionAfterIntroducer
clang::Parser::ParseCXXCasts
clang::Parser::ParseCXXTypeid
clang::Parser::ParseCXXUuidof
clang::Parser::ParseCXXPseudoDestructor
clang::Parser::ParseCXXThis
clang::Parser::ParseThrowExpression
clang::Parser::tryParseExceptionSpecification
clang::Parser::ParseDynamicExceptionSpecification
clang::Parser::ParseTrailingReturnType
clang::Parser::ParseCXXBoolLiteral
clang::Parser::ParseCXXTypeConstructExpression
clang::Parser::ParseCXXSimpleTypeSpecifier
clang::Parser::ParseCXXTypeSpecifierSeq
clang::Parser::ParseExpressionListOrTypeId
clang::Parser::ParseDirectNewDeclarator
clang::Parser::ParseCXXNewExpression
clang::Parser::ParseCXXDeleteExpression
clang::Parser::ParseCXXCondition
clang::Parser::ParseCoyieldExpression
clang::Parser::ParseInitializer
clang::Parser::MayBeDesignationStart
clang::Parser::ParseBraceInitializer
clang::Parser::ParseInitializerWithPotentialDesignator
clang::Parser::ParseBlockLiteralExpression
clang::Parser::ParseObjCAtExpression
clang::Parser::ParseObjCStringLiteral
clang::Parser::ParseObjCCharacterLiteral
clang::Parser::ParseObjCNumericLiteral
clang::Parser::ParseObjCBooleanLiteral
clang::Parser::ParseObjCArrayLiteral
clang::Parser::ParseObjCDictionaryLiteral
clang::Parser::ParseObjCBoxedExpr
clang::Parser::ParseObjCEncodeExpression
clang::Parser::ParseObjCSelectorExpression
clang::Parser::ParseObjCProtocolExpression
clang::Parser::isSimpleObjCMessageExpression
clang::Parser::ParseObjCMessageExpression
clang::Parser::ParseObjCMessageExpressionBody
clang::Parser::ParseAssignmentExprWithObjCMessageExprStart
clang::Parser::ParseObjCXXMessageReceiver
clang::Parser::ParseStatement
clang::Parser::ParseStatementOrDeclaration
clang::Parser::ParseStatementOrDeclarationAfterAttributes
clang::Parser::ParseExprStatement
clang::Parser::ParseLabeledStatement
clang::Parser::ParseCaseStatement
clang::Parser::ParseDefaultStatement
clang::Parser::ParseCompoundStatement
clang::Parser::ParseCompoundStatement
clang::Parser::ParseCompoundStatementLeadingPragmas
clang::Parser::ConsumeNullStmt
clang::Parser::ParseCompoundStatementBody
clang::Parser::ParseParenExprOrCondition
clang::Parser::ParseIfStatement
clang::Parser::ParseSwitchStatement
clang::Parser::ParseWhileStatement
clang::Parser::ParseDoStatement
clang::Parser::ParseForStatement
clang::Parser::ParseGotoStatement
clang::Parser::ParseContinueStatement
clang::Parser::ParseBreakStatement
clang::Parser::ParseReturnStatement
clang::Parser::ParseAsmStatement
clang::Parser::ParseMicrosoftAsmStatement
clang::Parser::ParsePragmaLoopHint
clang::Parser::IfExistsBehavior
clang::Parser::IfExistsCondition
clang::Parser::IfExistsCondition::KeywordLoc
clang::Parser::IfExistsCondition::IsIfExists
clang::Parser::IfExistsCondition::SS
clang::Parser::IfExistsCondition::Name
clang::Parser::IfExistsCondition::Behavior
clang::Parser::ParseMicrosoftIfExistsCondition
clang::Parser::ParseMicrosoftIfExistsStatement
clang::Parser::ParseMicrosoftIfExistsExternalDeclaration
clang::Parser::ParseMicrosoftIfExistsClassDeclaration
clang::Parser::ParseMicrosoftIfExistsBraceInitializer
clang::Parser::ParseAsmOperandsOpt
clang::Parser::ParseCXXTryBlock
clang::Parser::ParseCXXTryBlockCommon
clang::Parser::ParseCXXCatchBlock
clang::Parser::ParseSEHTryBlock
clang::Parser::ParseSEHExceptBlock
clang::Parser::ParseSEHFinallyBlock
clang::Parser::ParseSEHLeaveStatement
clang::Parser::ParseObjCAtStatement
clang::Parser::ParseObjCTryStmt
clang::Parser::ParseObjCThrowStmt
clang::Parser::ParseObjCSynchronizedStmt
clang::Parser::ParseObjCAutoreleasePoolStmt
clang::Parser::DeclSpecContext
clang::Parser::isTypeSpecifier
clang::Parser::isClassTemplateDeductionContext
clang::Parser::ForRangeInit
clang::Parser::ForRangeInit::ColonLoc
clang::Parser::ForRangeInit::RangeExpr
clang::Parser::ForRangeInit::ParsedForRangeDecl
clang::Parser::ForRangeInfo
clang::Parser::ForRangeInfo::LoopVar
clang::Parser::ParseDeclaration
clang::Parser::ParseSimpleDeclaration
clang::Parser::MightBeDeclarator
clang::Parser::ParseDeclGroup
clang::Parser::ParseDeclarationAfterDeclarator
clang::Parser::ParseAsmAttributesAfterDeclarator
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes
clang::Parser::ParseFunctionStatementBody
clang::Parser::ParseFunctionTryBlock
clang::Parser::trySkippingFunctionBody
clang::Parser::ParseImplicitInt
clang::Parser::getDeclSpecContextFromDeclaratorContext
clang::Parser::ParseDeclarationSpecifiers
clang::Parser::DiagnoseMissingSemiAfterTagDefinition
clang::Parser::ParseSpecifierQualifierList
clang::Parser::ParseObjCTypeQualifierList
clang::Parser::ParseEnumSpecifier
clang::Parser::ParseEnumBody
clang::Parser::ParseStructUnionBody
clang::Parser::ParseStructDeclaration
clang::Parser::isDeclarationSpecifier
clang::Parser::isTypeSpecifierQualifier
clang::Parser::isKnownToBeTypeSpecifier
clang::Parser::isKnownToBeDeclarationSpecifier
clang::Parser::isDeclarationStatement
clang::Parser::isForInitDeclaration
clang::Parser::isForRangeIdentifier
clang::Parser::isStartOfObjCClassMessageMissingOpenBracket
clang::Parser::isConstructorDeclarator
clang::Parser::TentativeCXXTypeIdContext
clang::Parser::isTypeIdInParens
clang::Parser::isTypeIdInParens
clang::Parser::isTypeIdUnambiguously
clang::Parser::isCXXDeclarationStatement
clang::Parser::isCXXSimpleDeclaration
clang::Parser::isCXXFunctionDeclarator
clang::Parser::ConditionOrInitStatement
clang::Parser::isCXXConditionDeclarationOrInitStatement
clang::Parser::isCXXTypeId
clang::Parser::isCXXTypeId
clang::Parser::TPResult
clang::Parser::isExpressionOrTypeSpecifierSimple
clang::Parser::isCXXDeclarationSpecifier
clang::Parser::isCXXDeclarationSpecifierAType
clang::Parser::isTentativelyDeclared
clang::Parser::TryParseSimpleDeclaration
clang::Parser::TryParseTypeofSpecifier
clang::Parser::TryParseProtocolQualifiers
clang::Parser::TryParsePtrOperatorSeq
clang::Parser::TryParseOperatorId
clang::Parser::TryParseInitDeclaratorList
clang::Parser::TryParseDeclarator
clang::Parser::TryParseParameterDeclarationClause
clang::Parser::TryParseFunctionDeclarator
clang::Parser::TryParseBracketDeclarator
clang::Parser::TryConsumeDeclarationSpecifier
clang::Parser::ParseTypeName
clang::Parser::ParseBlockId
clang::Parser::standardAttributesAllowed
clang::Parser::CheckProhibitedCXX11Attribute
clang::Parser::DiagnoseProhibitedCXX11Attribute
clang::Parser::CheckMisplacedCXX11Attribute
clang::Parser::DiagnoseMisplacedCXX11Attribute
clang::Parser::stripTypeAttributesOffDeclSpec
clang::Parser::ProhibitAttributes
clang::Parser::ProhibitAttributes
clang::Parser::DiagnoseProhibitedAttributes
clang::Parser::ProhibitCXX11Attributes
clang::Parser::SkipCXX11Attributes
clang::Parser::DiagnoseAndSkipCXX11Attributes
clang::Parser::ParseAttributeArgsCommon
clang::Parser::MaybeParseGNUAttributes
clang::Parser::MaybeParseGNUAttributes
clang::Parser::ParseGNUAttributes
clang::Parser::ParseGNUAttributeArgs
clang::Parser::ParseIdentifierLoc
clang::Parser::ParseClangAttributeArgs
clang::Parser::MaybeParseCXX11Attributes
clang::Parser::MaybeParseCXX11Attributes
clang::Parser::MaybeParseCXX11Attributes
clang::Parser::ParseCXX11AttributeSpecifier
clang::Parser::ParseCXX11Attributes
clang::Parser::ParseCXX11AttributeArgs
clang::Parser::TryParseCXX11AttributeIdentifier
clang::Parser::MaybeParseMicrosoftAttributes
clang::Parser::ParseMicrosoftUuidAttributeArgs
clang::Parser::ParseMicrosoftAttributes
clang::Parser::MaybeParseMicrosoftDeclSpecs
clang::Parser::ParseMicrosoftDeclSpecs
clang::Parser::ParseMicrosoftDeclSpecArgs
clang::Parser::ParseMicrosoftTypeAttributes
clang::Parser::DiagnoseAndSkipExtendedMicrosoftTypeAttributes
clang::Parser::SkipExtendedMicrosoftTypeAttributes
clang::Parser::ParseMicrosoftInheritanceClassAttributes
clang::Parser::ParseBorlandTypeAttributes
clang::Parser::ParseOpenCLKernelAttributes
clang::Parser::ParseOpenCLQualifiers
clang::Parser::MaybeParseOpenCLUnrollHintAttribute
clang::Parser::ParseOpenCLUnrollHintAttribute
clang::Parser::ParseNullabilityTypeSpecifiers
clang::Parser::ParseVersionTuple
clang::Parser::ParseAvailabilityAttribute
clang::Parser::ParseAvailabilitySpec
clang::Parser::ParseAvailabilityCheckExpr
clang::Parser::ParseExternalSourceSymbolAttribute
clang::Parser::ParseObjCBridgeRelatedAttribute
clang::Parser::ParseTypeTagForDatatypeAttribute
clang::Parser::ParseAttributeWithTypeArg
clang::Parser::ParseTypeofSpecifier
clang::Parser::ParseDecltypeSpecifier
clang::Parser::AnnotateExistingDecltypeSpecifier
clang::Parser::ParseUnderlyingTypeSpecifier
clang::Parser::ParseAtomicSpecifier
clang::Parser::ParseAlignArgument
clang::Parser::ParseAlignmentSpecifier
clang::Parser::isCXX11VirtSpecifier
clang::Parser::isCXX11VirtSpecifier
clang::Parser::ParseOptionalCXX11VirtSpecifierSeq
clang::Parser::isCXX11FinalKeyword
clang::Parser::DeclaratorScopeObj
clang::Parser::DeclaratorScopeObj::P
clang::Parser::DeclaratorScopeObj::SS
clang::Parser::DeclaratorScopeObj::EnteredScope
clang::Parser::DeclaratorScopeObj::CreatedScope
clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope
clang::Parser::ParseDeclarator
clang::Parser::ParseDeclaratorInternal
clang::Parser::AttrRequirements
clang::Parser::ParseTypeQualifierListOpt
clang::Parser::ParseDirectDeclarator
clang::Parser::ParseDecompositionDeclarator
clang::Parser::ParseParenDeclarator
clang::Parser::ParseFunctionDeclarator
clang::Parser::ParseRefQualifier
clang::Parser::isFunctionDeclaratorIdentifierList
clang::Parser::ParseFunctionDeclaratorIdentifierList
clang::Parser::ParseParameterDeclarationClause
clang::Parser::ParseBracketDeclarator
clang::Parser::ParseMisplacedBracketDeclarator
clang::Parser::CXX11AttributeKind
clang::Parser::isCXX11AttributeSpecifier
clang::Parser::DiagnoseUnexpectedNamespace
clang::Parser::ParseNamespace
clang::Parser::InnerNamespaceInfo
clang::Parser::InnerNamespaceInfo::NamespaceLoc
clang::Parser::InnerNamespaceInfo::InlineLoc
clang::Parser::InnerNamespaceInfo::IdentLoc
clang::Parser::InnerNamespaceInfo::Ident
clang::Parser::ParseInnerNamespace
clang::Parser::ParseLinkage
clang::Parser::ParseExportDeclaration
clang::Parser::ParseUsingDirectiveOrDeclaration
clang::Parser::ParseUsingDirective
clang::Parser::UsingDeclarator
clang::Parser::UsingDeclarator::TypenameLoc
clang::Parser::UsingDeclarator::SS
clang::Parser::UsingDeclarator::Name
clang::Parser::UsingDeclarator::EllipsisLoc
clang::Parser::UsingDeclarator::clear
clang::Parser::ParseUsingDeclarator
clang::Parser::ParseUsingDeclaration
clang::Parser::ParseAliasDeclarationAfterDeclarator
clang::Parser::ParseStaticAssertDeclaration
clang::Parser::ParseNamespaceAlias
clang::Parser::isValidAfterTypeSpecifier
clang::Parser::ParseClassSpecifier
clang::Parser::SkipCXXMemberSpecification
clang::Parser::ParseCXXMemberSpecification
clang::Parser::ParseCXXMemberInitializer
clang::Parser::ParseCXXMemberDeclaratorBeforeInitializer
clang::Parser::MaybeParseAndDiagnoseDeclSpecAfterCXX11VirtSpecifierSeq
clang::Parser::ParseCXXClassMemberDeclaration
clang::Parser::ParseCXXClassMemberDeclarationWithPragmas
clang::Parser::ParseConstructorInitializer
clang::Parser::ParseMemInitializer
clang::Parser::HandleMemberFunctionDeclDelays
clang::Parser::ParseBaseTypeSpecifier
clang::Parser::ParseBaseClause
clang::Parser::ParseBaseSpecifier
clang::Parser::getAccessSpecifierIfPresent
clang::Parser::ParseUnqualifiedIdTemplateId
clang::Parser::ParseUnqualifiedIdOperator
clang::Parser::ParseOMPDeclareSimdClauses
clang::Parser::ParseOMPDeclareTargetClauses
clang::Parser::ParseOMPEndDeclareTargetDirective
clang::Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl
clang::Parser::ParseOpenMPDeclareReductionDirective
clang::Parser::ParseOpenMPReductionInitializerForDecl
clang::Parser::ParseOpenMPDeclareMapperDirective
clang::Parser::parseOpenMPDeclareMapperVarDecl
clang::Parser::ParseOpenMPSimpleVarList
clang::Parser::ParseOpenMPDeclarativeOrExecutableDirective
clang::Parser::ParseOpenMPClause
clang::Parser::ParseOpenMPSingleExprClause
clang::Parser::ParseOpenMPSimpleClause
clang::Parser::ParseOpenMPSingleExprWithArgClause
clang::Parser::ParseOpenMPClause
clang::Parser::ParseOpenMPVarListClause
clang::Parser::ParseOpenMPParensExpr
clang::Parser::OpenMPVarListDataTy
clang::Parser::OpenMPVarListDataTy::TailExpr
clang::Parser::OpenMPVarListDataTy::ColonLoc
clang::Parser::OpenMPVarListDataTy::RLoc
clang::Parser::OpenMPVarListDataTy::ReductionOrMapperIdScopeSpec
clang::Parser::OpenMPVarListDataTy::ReductionOrMapperId
clang::Parser::OpenMPVarListDataTy::DepKind
clang::Parser::OpenMPVarListDataTy::LinKind
clang::Parser::OpenMPVarListDataTy::MapTypeModifiers
clang::Parser::OpenMPVarListDataTy::MapTypeModifiersLoc
clang::Parser::OpenMPVarListDataTy::MapType
clang::Parser::OpenMPVarListDataTy::IsMapTypeImplicit
clang::Parser::OpenMPVarListDataTy::DepLinMapLoc
clang::Parser::ParseOpenMPVarList
clang::Parser::ParseUnqualifiedId
clang::Parser::parseMapperModifier
clang::Parser::parseMapTypeModifiers
clang::Parser::ParseDeclarationStartingWithTemplate
clang::Parser::ParseTemplateDeclarationOrSpecialization
clang::Parser::ParseSingleDeclarationAfterTemplate
clang::Parser::ParseTemplateParameters
clang::Parser::ParseTemplateParameterList
clang::Parser::isStartOfTemplateTypeParameter
clang::Parser::ParseTemplateParameter
clang::Parser::ParseTypeParameter
clang::Parser::ParseTemplateTemplateParameter
clang::Parser::ParseNonTypeTemplateParameter
clang::Parser::DiagnoseMisplacedEllipsis
clang::Parser::DiagnoseMisplacedEllipsisInDeclarator
clang::Parser::ParseGreaterThanInTemplateList
clang::Parser::ParseTemplateIdAfterTemplateName
clang::Parser::AnnotateTemplateIdToken
clang::Parser::AnnotateTemplateIdTokenAsType
clang::Parser::IsTemplateArgumentList
clang::Parser::ParseTemplateArgumentList
clang::Parser::ParseTemplateTemplateArgument
clang::Parser::ParseTemplateArgument
clang::Parser::ParseExplicitInstantiation
clang::Parser::ParseModuleDecl
clang::Parser::ParseModuleImport
clang::Parser::parseMisplacedModuleImport
clang::Parser::tryParseMisplacedModuleImport
clang::Parser::ParseModuleName
clang::Parser::ParseTypeTrait
clang::Parser::ParseArrayTypeTrait
clang::Parser::ParseExpressionTrait
clang::Parser::CodeCompleteDirective
clang::Parser::CodeCompleteInConditionalExclusion
clang::Parser::CodeCompleteMacroName
clang::Parser::CodeCompletePreprocessorExpression
clang::Parser::CodeCompleteMacroArgument
clang::Parser::CodeCompleteIncludedFile
clang::Parser::CodeCompleteNaturalLanguage