diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-03-08 21:51:21 +0000 |
commit | bea522ff43a3f11c7a2bc7949119dbb9fce19e39 (patch) | |
tree | 7e720ef716401a1b50dda348b13a9b8a108e1200 /include/clang | |
parent | 303b96f255d61ae3dff913d777d3f40332786257 (diff) |
ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 3 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 2 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 33 |
3 files changed, 34 insertions, 4 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index d12d0545c5..d4878a99a6 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -993,8 +993,7 @@ public: } /// \brief Return a normal function type with a typed argument list. - QualType getFunctionType(QualType ResultTy, - const QualType *Args, unsigned NumArgs, + QualType getFunctionType(QualType ResultTy, ArrayRef<QualType> Args, const FunctionProtoType::ExtProtoInfo &EPI) const; /// \brief Return the unique reference to the type for the specified type diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index f9fc90dc07..10143a67ca 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -2797,7 +2797,7 @@ private: return false; } - FunctionProtoType(QualType result, const QualType *args, unsigned numArgs, + FunctionProtoType(QualType result, ArrayRef<QualType> args, QualType canonical, const ExtProtoInfo &epi); /// NumArgs - The number of arguments this function has, not counting '...'. diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 397bd14d8a..b0d3ad865b 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -944,12 +944,43 @@ public: SourceRange Brackets, DeclarationName Entity); QualType BuildExtVectorType(QualType T, Expr *ArraySize, SourceLocation AttrLoc); + + /// \brief Build a function type. + /// + /// This routine checks the function type according to C++ rules and + /// under the assumption that the result type and parameter types have + /// just been instantiated from a template. It therefore duplicates + /// some of the behavior of GetTypeForDeclarator, but in a much + /// simpler form that is only suitable for this narrow use case. + /// + /// \param T The return type of the function. + /// + /// \param ParamTypes The parameter types of the function. This array + /// will be modified to account for adjustments to the types of the + /// function parameters. + /// + /// \param Variadic Whether this is a variadic function type. + /// + /// \param HasTrailingReturn Whether this function has a trailing return type. + /// + /// \param Quals The cvr-qualifiers to be applied to the function type. + /// + /// \param Loc The location of the entity whose type involves this + /// function type or, if there is no such entity, the location of the + /// type that will have function type. + /// + /// \param Entity The name of the entity that involves the function + /// type, if known. + /// + /// \returns A suitable function type, if there are no errors. + /// Otherwise, returns a NULL type. QualType BuildFunctionType(QualType T, - QualType *ParamTypes, unsigned NumParamTypes, + llvm::MutableArrayRef<QualType> ParamTypes, bool Variadic, bool HasTrailingReturn, unsigned Quals, RefQualifierKind RefQualifier, SourceLocation Loc, DeclarationName Entity, FunctionType::ExtInfo Info); + QualType BuildMemberPointerType(QualType T, QualType Class, SourceLocation Loc, DeclarationName Entity); |