diff options
author | John McCall <rjmccall@apple.com> | 2016-03-01 00:49:02 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2016-03-01 00:49:02 +0000 |
commit | f169ff036d62e4f7c664efc7b25d07650f00be32 (patch) | |
tree | 4ad9d2b77636b71807224864600677f805596799 /lib/AST/Type.cpp | |
parent | 19a1c8c8d40837d4045c052aeb9b7d06ad9a4d57 (diff) |
Generalize the consumed-parameter array on FunctionProtoType
to allow arbitrary data to be associated with a parameter.
Also, fix a bug where we apparently haven't been serializing
this information for the last N years.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index b467dac66b..6cd6c2a006 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -2671,7 +2671,7 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params, NumParams(params.size()), NumExceptions(epi.ExceptionSpec.Exceptions.size()), ExceptionSpecType(epi.ExceptionSpec.Type), - HasAnyConsumedParams(epi.ConsumedParameters != nullptr), + HasExtParameterInfos(epi.ExtParameterInfos != nullptr), Variadic(epi.Variadic), HasTrailingReturn(epi.HasTrailingReturn) { assert(NumParams == params.size() && "function has too many parameters"); @@ -2737,10 +2737,11 @@ FunctionProtoType::FunctionProtoType(QualType result, ArrayRef<QualType> params, slot[0] = epi.ExceptionSpec.SourceDecl; } - if (epi.ConsumedParameters) { - bool *consumedParams = const_cast<bool *>(getConsumedParamsBuffer()); + if (epi.ExtParameterInfos) { + ExtParameterInfo *extParamInfos = + const_cast<ExtParameterInfo *>(getExtParameterInfosBuffer()); for (unsigned i = 0; i != NumParams; ++i) - consumedParams[i] = epi.ConsumedParameters[i]; + extParamInfos[i] = epi.ExtParameterInfos[i]; } } @@ -2860,9 +2861,9 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID, QualType Result, epi.ExceptionSpec.Type == EST_Unevaluated) { ID.AddPointer(epi.ExceptionSpec.SourceDecl->getCanonicalDecl()); } - if (epi.ConsumedParameters) { + if (epi.ExtParameterInfos) { for (unsigned i = 0; i != NumParams; ++i) - ID.AddBoolean(epi.ConsumedParameters[i]); + ID.AddInteger(epi.ExtParameterInfos[i].getOpaqueValue()); } epi.ExtInfo.Profile(ID); ID.AddBoolean(epi.HasTrailingReturn); |