diff options
author | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-01-09 11:25:09 +0000 |
---|---|---|
committer | Anastasia Stulova <anastasia.stulova@arm.com> | 2019-01-09 11:25:09 +0000 |
commit | 7f43dcfad8b0ba27dda9b1de50a9787f2473e928 (patch) | |
tree | e38a35cce1ad99aed238cc0fd60fa93a6335cba2 /lib/Parse/ParseDecl.cpp | |
parent | a1312e9156064555daacf6a2daa19b9060f5b980 (diff) | |
download | clang-7f43dcfad8b0ba27dda9b1de50a9787f2473e928.tar.gz |
Use DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.
Rather than duplicating data fields, use DeclSpec directly to store
the qualifiers for the functions/methods. This change doesn't handle
attributes yet and has to be extended further.
Differential revision: https://reviews.llvm.org/D55948
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 7538b635f0..298a2bad56 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -6072,9 +6072,6 @@ void Parser::ParseFunctionDeclarator(Declarator &D, DeclSpec DS(AttrFactory); bool RefQualifierIsLValueRef = true; SourceLocation RefQualifierLoc; - SourceLocation ConstQualifierLoc; - SourceLocation VolatileQualifierLoc; - SourceLocation RestrictQualifierLoc; ExceptionSpecificationType ESpecType = EST_None; SourceRange ESpecRange; SmallVector<ParsedType, 2> DynamicExceptions; @@ -6137,9 +6134,6 @@ void Parser::ParseFunctionDeclarator(Declarator &D, })); if (!DS.getSourceRange().getEnd().isInvalid()) { EndLoc = DS.getSourceRange().getEnd(); - ConstQualifierLoc = DS.getConstSpecLoc(); - VolatileQualifierLoc = DS.getVolatileSpecLoc(); - RestrictQualifierLoc = DS.getRestrictSpecLoc(); } // Parse ref-qualifier[opt]. @@ -6239,15 +6233,13 @@ void Parser::ParseFunctionDeclarator(Declarator &D, D.AddTypeInfo(DeclaratorChunk::getFunction( HasProto, IsAmbiguous, LParenLoc, ParamInfo.data(), ParamInfo.size(), EllipsisLoc, RParenLoc, - DS.getTypeQualifiers(), RefQualifierIsLValueRef, - RefQualifierLoc, ConstQualifierLoc, VolatileQualifierLoc, - RestrictQualifierLoc, - /*MutableLoc=*/SourceLocation(), ESpecType, ESpecRange, - DynamicExceptions.data(), DynamicExceptionRanges.data(), - DynamicExceptions.size(), + RefQualifierIsLValueRef, RefQualifierLoc, + /*MutableLoc=*/SourceLocation(), + ESpecType, ESpecRange, DynamicExceptions.data(), + DynamicExceptionRanges.data(), DynamicExceptions.size(), NoexceptExpr.isUsable() ? NoexceptExpr.get() : nullptr, ExceptionSpecTokens, DeclsInPrototype, StartLoc, - LocalEndLoc, D, TrailingReturnType), + LocalEndLoc, D, TrailingReturnType, &DS), std::move(FnAttrs), EndLoc); } |