Preserve calling convention etc. across template instantiations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110304 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h
index 1345960..59a628a 100644
--- a/lib/Sema/Sema.h
+++ b/lib/Sema/Sema.h
@@ -769,7 +769,8 @@
QualType BuildFunctionType(QualType T,
QualType *ParamTypes, unsigned NumParamTypes,
bool Variadic, unsigned Quals,
- SourceLocation Loc, DeclarationName Entity);
+ SourceLocation Loc, DeclarationName Entity,
+ const FunctionType::ExtInfo &Info);
QualType BuildMemberPointerType(QualType T, QualType Class,
SourceLocation Loc,
DeclarationName Entity);
diff --git a/lib/Sema/SemaTemplateDeduction.cpp b/lib/Sema/SemaTemplateDeduction.cpp
index 403d554..885cb06 100644
--- a/lib/Sema/SemaTemplateDeduction.cpp
+++ b/lib/Sema/SemaTemplateDeduction.cpp
@@ -1245,7 +1245,8 @@
Proto->isVariadic(),
Proto->getTypeQuals(),
Function->getLocation(),
- Function->getDeclName());
+ Function->getDeclName(),
+ Proto->getExtInfo());
if (FunctionType->isNull() || Trap.hasErrorOccurred())
return TDK_SubstitutionFailure;
}
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index feff524..b3df9eb 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -811,7 +811,8 @@
QualType *ParamTypes,
unsigned NumParamTypes,
bool Variadic, unsigned Quals,
- SourceLocation Loc, DeclarationName Entity) {
+ SourceLocation Loc, DeclarationName Entity,
+ const FunctionType::ExtInfo &Info) {
if (T->isArrayType() || T->isFunctionType()) {
Diag(Loc, diag::err_func_returning_array_function)
<< T->isFunctionType() << T;
@@ -833,8 +834,7 @@
return QualType();
return Context.getFunctionType(T, ParamTypes, NumParamTypes, Variadic,
- Quals, false, false, 0, 0,
- FunctionType::ExtInfo());
+ Quals, false, false, 0, 0, Info);
}
/// \brief Build a member pointer type \c T Class::*.
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 9920e4e..d13219d 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -468,7 +468,8 @@
QualType RebuildFunctionProtoType(QualType T,
QualType *ParamTypes,
unsigned NumParamTypes,
- bool Variadic, unsigned Quals);
+ bool Variadic, unsigned Quals,
+ const FunctionType::ExtInfo &Info);
/// \brief Build a new unprototyped function type.
QualType RebuildFunctionNoProtoType(QualType ResultType);
@@ -2932,7 +2933,8 @@
ParamTypes.data(),
ParamTypes.size(),
T->isVariadic(),
- T->getTypeQuals());
+ T->getTypeQuals(),
+ T->getExtInfo());
if (Result.isNull())
return QualType();
}
@@ -6252,7 +6254,8 @@
ParamTypes.data(),
ParamTypes.size(),
BD->isVariadic(),
- 0);
+ 0,
+ BExprFunctionType->getExtInfo());
CurBlock->FunctionType = FunctionType;
return SemaRef.ActOnBlockStmtExpr(CaretLoc, move(Body), /*Scope=*/0);
@@ -6429,11 +6432,13 @@
QualType *ParamTypes,
unsigned NumParamTypes,
bool Variadic,
- unsigned Quals) {
+ unsigned Quals,
+ const FunctionType::ExtInfo &Info) {
return SemaRef.BuildFunctionType(T, ParamTypes, NumParamTypes, Variadic,
Quals,
getDerived().getBaseLocation(),
- getDerived().getBaseEntity());
+ getDerived().getBaseEntity(),
+ Info);
}
template<typename Derived>