summaryrefslogtreecommitdiffstats
path: root/clang/include/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang')
-rw-r--r--clang/include/clang/Parse/DeclSpec.h32
-rw-r--r--clang/include/clang/Parse/Parser.h4
2 files changed, 28 insertions, 8 deletions
diff --git a/clang/include/clang/Parse/DeclSpec.h b/clang/include/clang/Parse/DeclSpec.h
index e1f52a02466..e97c20f2d19 100644
--- a/clang/include/clang/Parse/DeclSpec.h
+++ b/clang/include/clang/Parse/DeclSpec.h
@@ -512,31 +512,45 @@ struct DeclaratorChunk {
/// argument. If the function is () or (a,b,c), then it has no prototype,
/// and is treated as a K&R-style function.
bool hasPrototype : 1;
-
+
/// isVariadic - If this function has a prototype, and if that
/// proto ends with ',...)', this is true. When true, EllipsisLoc
/// contains the location of the ellipsis.
bool isVariadic : 1;
- /// When isVariadic is true, the location of the ellipsis in the source.
- unsigned EllipsisLoc;
-
/// The type qualifiers: const/volatile/restrict.
/// The qualifier bitmask values are the same as in QualType.
unsigned TypeQuals : 3;
+ /// hasExceptionSpec - True if the function has an exception specification.
+ bool hasExceptionSpec : 1;
+
+ /// hasAnyExceptionSpec - True if the function has a throw(...) specifier.
+ bool hasAnyExceptionSpec : 1;
+
/// DeleteArgInfo - If this is true, we need to delete[] ArgInfo.
bool DeleteArgInfo : 1;
+ /// When isVariadic is true, the location of the ellipsis in the source.
+ unsigned EllipsisLoc;
+
/// NumArgs - This is the number of formal arguments provided for the
/// declarator.
unsigned NumArgs;
+ /// NumExceptions - This is the number of types in the exception-decl, if
+ /// the function has one.
+ unsigned NumExceptions;
+
/// ArgInfo - This is a pointer to a new[]'d array of ParamInfo objects that
/// describe the arguments for this function declarator. This is null if
/// there are no arguments specified.
ParamInfo *ArgInfo;
-
+
+ /// Exceptions - This is a pointer to a new[]'d array of TypeTy pointers
+ /// that contains the types in the function's exception specification.
+ ActionBase::TypeTy **Exceptions;
+
/// freeArgs - reset the argument list to having zero arguments. This is
/// used in various places for error recovery.
void freeArgs() {
@@ -546,10 +560,11 @@ struct DeclaratorChunk {
}
NumArgs = 0;
}
-
+
void destroy() {
if (DeleteArgInfo)
delete[] ArgInfo;
+ delete[] Exceptions;
}
SourceLocation getEllipsisLoc() const {
@@ -670,7 +685,10 @@ struct DeclaratorChunk {
static DeclaratorChunk getFunction(bool hasProto, bool isVariadic,
SourceLocation EllipsisLoc,
ParamInfo *ArgInfo, unsigned NumArgs,
- unsigned TypeQuals, SourceLocation Loc,
+ unsigned TypeQuals, bool hasExceptionSpec,
+ bool hasAnyExceptionSpec,
+ ActionBase::TypeTy **Exceptions,
+ unsigned NumExceptions, SourceLocation Loc,
Declarator &TheDeclarator);
/// getBlockPointer - Return a DeclaratorChunk for a block.
diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index fdb2327d4b3..084996d61c1 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -682,7 +682,9 @@ private:
// C++ 15: C++ Throw Expression
OwningExprResult ParseThrowExpression();
// EndLoc is filled with the location of the last token of the specification.
- bool ParseExceptionSpecification(SourceLocation &EndLoc);
+ bool ParseExceptionSpecification(SourceLocation &EndLoc,
+ std::vector<TypeTy*> &Exceptions,
+ bool &hasAnyExceptionSpec);
//===--------------------------------------------------------------------===//
// C++ 2.13.5: C++ Boolean Literals
OpenPOWER on IntegriCloud