@@ -4845,8 +4845,7 @@ ParamDecl::ParamDecl(ParamDecl *PD, bool withTypes)
4845
4845
ArgumentName (PD->getArgumentName ()),
4846
4846
ArgumentNameLoc (PD->getArgumentNameLoc ()),
4847
4847
SpecifierLoc (PD->getSpecifierLoc ()),
4848
- DefaultValueAndIsVariadic (nullptr , PD->DefaultValueAndIsVariadic .getInt ()),
4849
- IsAutoClosure (PD->isAutoClosure ()) {
4848
+ DefaultValueAndFlags (nullptr , PD->DefaultValueAndFlags .getInt ()) {
4850
4849
Bits.ParamDecl .IsTypeLocImplicit = PD->Bits .ParamDecl .IsTypeLocImplicit ;
4851
4850
Bits.ParamDecl .defaultArgumentKind = PD->Bits .ParamDecl .defaultArgumentKind ;
4852
4851
typeLoc = PD->getTypeLoc ().clone (PD->getASTContext ());
@@ -4942,19 +4941,19 @@ Type ParamDecl::getVarargBaseTy(Type VarArgT) {
4942
4941
}
4943
4942
4944
4943
void ParamDecl::setDefaultValue (Expr *E) {
4945
- if (!DefaultValueAndIsVariadic .getPointer ()) {
4944
+ if (!DefaultValueAndFlags .getPointer ()) {
4946
4945
if (!E) return ;
4947
4946
4948
- DefaultValueAndIsVariadic .setPointer (
4949
- getASTContext ().Allocate <StoredDefaultArgument>());
4947
+ DefaultValueAndFlags .setPointer (
4948
+ getASTContext ().Allocate <StoredDefaultArgument>());
4950
4949
}
4951
4950
4952
- DefaultValueAndIsVariadic .getPointer ()->DefaultArg = E;
4951
+ DefaultValueAndFlags .getPointer ()->DefaultArg = E;
4953
4952
}
4954
4953
4955
4954
void ParamDecl::setDefaultArgumentInitContext (Initializer *initContext) {
4956
- assert (DefaultValueAndIsVariadic .getPointer ());
4957
- DefaultValueAndIsVariadic .getPointer ()->InitContext = initContext;
4955
+ assert (DefaultValueAndFlags .getPointer ());
4956
+ DefaultValueAndFlags .getPointer ()->InitContext = initContext;
4958
4957
}
4959
4958
4960
4959
StringRef
@@ -4964,10 +4963,9 @@ ParamDecl::getDefaultValueStringRepresentation(
4964
4963
case DefaultArgumentKind::None:
4965
4964
llvm_unreachable (" called on a ParamDecl with no default value" );
4966
4965
case DefaultArgumentKind::Normal: {
4967
- assert (DefaultValueAndIsVariadic .getPointer () &&
4966
+ assert (DefaultValueAndFlags .getPointer () &&
4968
4967
" default value not provided yet" );
4969
- auto existing =
4970
- DefaultValueAndIsVariadic.getPointer ()->StringRepresentation ;
4968
+ auto existing = DefaultValueAndFlags.getPointer ()->StringRepresentation ;
4971
4969
if (!existing.empty ())
4972
4970
return existing;
4973
4971
return extractInlinableText (getASTContext ().SourceMgr , getDefaultValue (),
@@ -4994,12 +4992,12 @@ ParamDecl::setDefaultValueStringRepresentation(StringRef stringRepresentation) {
4994
4992
assert (getDefaultArgumentKind () == DefaultArgumentKind::Normal);
4995
4993
assert (!stringRepresentation.empty ());
4996
4994
4997
- if (!DefaultValueAndIsVariadic .getPointer ()) {
4998
- DefaultValueAndIsVariadic .setPointer (
4999
- getASTContext ().Allocate <StoredDefaultArgument>());
4995
+ if (!DefaultValueAndFlags .getPointer ()) {
4996
+ DefaultValueAndFlags .setPointer (
4997
+ getASTContext ().Allocate <StoredDefaultArgument>());
5000
4998
}
5001
4999
5002
- DefaultValueAndIsVariadic .getPointer ()->StringRepresentation =
5000
+ DefaultValueAndFlags .getPointer ()->StringRepresentation =
5003
5001
stringRepresentation;
5004
5002
}
5005
5003
0 commit comments