Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Parse/ParseDecl.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 2,048 Lines • ▼ Show 20 Lines | Parser::DeclGroupPtrTy Parser::ParseDeclGroup(ParsingDeclSpec &DS, | ||||
ParseDeclarator(D); | ParseDeclarator(D); | ||||
// Bail out if the first declarator didn't seem well-formed. | // Bail out if the first declarator didn't seem well-formed. | ||||
if (!D.hasName() && !D.mayOmitIdentifier()) { | if (!D.hasName() && !D.mayOmitIdentifier()) { | ||||
SkipMalformedDecl(); | SkipMalformedDecl(); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
if (getLangOpts().HLSL) | |||||
MaybeParseHLSLSemantics(D); | |||||
if (Tok.is(tok::kw_requires)) | if (Tok.is(tok::kw_requires)) | ||||
ParseTrailingRequiresClause(D); | ParseTrailingRequiresClause(D); | ||||
// Save late-parsed attributes for now; they need to be parsed in the | // Save late-parsed attributes for now; they need to be parsed in the | ||||
// appropriate function scope after the function Decl has been constructed. | // appropriate function scope after the function Decl has been constructed. | ||||
// These will be parsed in ParseFunctionDefinition or ParseLexedAttrList. | // These will be parsed in ParseFunctionDefinition or ParseLexedAttrList. | ||||
LateParsedAttrList LateParsedAttrs(true); | LateParsedAttrList LateParsedAttrs(true); | ||||
if (D.isFunctionDeclarator()) { | if (D.isFunctionDeclarator()) { | ||||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Lines | while (TryConsumeToken(tok::comma, CommaLoc)) { | ||||
// short x, __attribute__((common)) var; -> declarator | // short x, __attribute__((common)) var; -> declarator | ||||
MaybeParseGNUAttributes(D); | MaybeParseGNUAttributes(D); | ||||
// MSVC parses but ignores qualifiers after the comma as an extension. | // MSVC parses but ignores qualifiers after the comma as an extension. | ||||
if (getLangOpts().MicrosoftExt) | if (getLangOpts().MicrosoftExt) | ||||
DiagnoseAndSkipExtendedMicrosoftTypeAttributes(); | DiagnoseAndSkipExtendedMicrosoftTypeAttributes(); | ||||
ParseDeclarator(D); | ParseDeclarator(D); | ||||
if (getLangOpts().HLSL) | |||||
MaybeParseHLSLSemantics(D); | |||||
if (!D.isInvalidType()) { | if (!D.isInvalidType()) { | ||||
// C++2a [dcl.decl]p1 | // C++2a [dcl.decl]p1 | ||||
// init-declarator: | // init-declarator: | ||||
// declarator initializer[opt] | // declarator initializer[opt] | ||||
// declarator requires-clause | // declarator requires-clause | ||||
if (Tok.is(tok::kw_requires)) | if (Tok.is(tok::kw_requires)) | ||||
ParseTrailingRequiresClause(D); | ParseTrailingRequiresClause(D); | ||||
Decl *ThisDecl = ParseDeclarationAfterDeclarator(D); | Decl *ThisDecl = ParseDeclarationAfterDeclarator(D); | ||||
▲ Show 20 Lines • Show All 5,414 Lines • Show Last 20 Lines |