diff options
author | John McCall <rjmccall@apple.com> | 2010-12-14 06:51:39 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-14 06:51:39 +0000 |
commit | 0e88aa7100da32acc63bc8a4dcb946ed517868f1 (patch) | |
tree | 1e40b8565309154c96cb5997ad4f615a0b8d6ff4 /lib/Sema/SemaDecl.cpp | |
parent | 54eeba75d3914e457204a159a7888fc19e50a6dc (diff) |
Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around. The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 403838176c..66e517008c 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -1285,10 +1285,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { OldProto->arg_type_end()); NewQType = Context.getFunctionType(NewFuncType->getResultType(), ParamTypes.data(), ParamTypes.size(), - OldProto->isVariadic(), - OldProto->getTypeQuals(), - false, false, 0, 0, - OldProto->getExtInfo()); + OldProto->getExtProtoInfo()); New->setType(NewQType); New->setHasInheritedPrototype(); @@ -1370,9 +1367,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { New->setType(Context.getFunctionType(MergedReturn, &ArgTypes[0], ArgTypes.size(), - OldProto->isVariadic(), 0, - false, false, 0, 0, - OldProto->getExtInfo())); + OldProto->getExtProtoInfo())); return MergeCompatibleFunctionDecls(New, Old); } @@ -4046,9 +4041,11 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, // Turn this into a variadic function with no parameters. const FunctionType *FT = NewFD->getType()->getAs<FunctionType>(); - QualType R = Context.getFunctionType(FT->getResultType(), - 0, 0, true, 0, false, false, 0, 0, - FT->getExtInfo()); + FunctionProtoType::ExtProtoInfo EPI; + EPI.Variadic = true; + EPI.ExtInfo = FT->getExtInfo(); + + QualType R = Context.getFunctionType(FT->getResultType(), 0, 0, EPI); NewFD->setType(R); } |