diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-29 17:30:04 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-29 17:30:04 +0000 |
commit | 7dc813462dd9fd3f6f4296f896a12de14264fef8 (patch) | |
tree | ef3f4354bdb9ebc59c51598c6ed9a801a30a7745 /lib/Parse/DeclSpec.cpp | |
parent | 552333cfa9c91d3be656699dacf7c5e98e875ee8 (diff) |
Have the parser communicate the exception specification to the action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/DeclSpec.cpp')
-rw-r--r-- | lib/Parse/DeclSpec.cpp | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/lib/Parse/DeclSpec.cpp b/lib/Parse/DeclSpec.cpp index bcf14d916c..d742ef2ed0 100644 --- a/lib/Parse/DeclSpec.cpp +++ b/lib/Parse/DeclSpec.cpp @@ -32,19 +32,27 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, ParamInfo *ArgInfo, unsigned NumArgs, unsigned TypeQuals, + bool hasExceptionSpec, + bool hasAnyExceptionSpec, + ActionBase::TypeTy **Exceptions, + unsigned NumExceptions, SourceLocation Loc, Declarator &TheDeclarator) { DeclaratorChunk I; - I.Kind = Function; - I.Loc = Loc; - I.Fun.hasPrototype = hasProto; - I.Fun.isVariadic = isVariadic; - I.Fun.EllipsisLoc = EllipsisLoc.getRawEncoding(); - I.Fun.DeleteArgInfo = false; - I.Fun.TypeQuals = TypeQuals; - I.Fun.NumArgs = NumArgs; - I.Fun.ArgInfo = 0; - + I.Kind = Function; + I.Loc = Loc; + I.Fun.hasPrototype = hasProto; + I.Fun.isVariadic = isVariadic; + I.Fun.EllipsisLoc = EllipsisLoc.getRawEncoding(); + I.Fun.DeleteArgInfo = false; + I.Fun.TypeQuals = TypeQuals; + I.Fun.NumArgs = NumArgs; + I.Fun.ArgInfo = 0; + I.Fun.hasExceptionSpec = hasExceptionSpec; + I.Fun.hasAnyExceptionSpec = hasAnyExceptionSpec; + I.Fun.NumExceptions = NumExceptions; + I.Fun.Exceptions = 0; + // new[] an argument array if needed. if (NumArgs) { // If the 'InlineParams' in Declarator is unused and big enough, put our @@ -62,6 +70,12 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, } memcpy(I.Fun.ArgInfo, ArgInfo, sizeof(ArgInfo[0])*NumArgs); } + // new[] an exception array if needed + if (NumExceptions) { + I.Fun.Exceptions = new ActionBase::TypeTy*[NumExceptions]; + memcpy(I.Fun.Exceptions, Exceptions, + sizeof(ActionBase::TypeTy*)*NumExceptions); + } return I; } |