diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-08 17:45:32 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-08 17:45:32 +0000 |
commit | 0ae7b3f1d5403265f693ed75384603ca8fbba74d (patch) | |
tree | 5551031460d1b0cdb7ad8a752c21d21f239e265f /lib/AST/TypePrinter.cpp | |
parent | 7b682656310b0d7e94a98d982444bc7ddedc653f (diff) |
Implement template instantiation for exception specifications. Also,
print exception specifications on function types and
declarations. Fixes <rdar://problem/7450999>.
There is some poor source-location information here, because we don't
track locations of the types in exception specifications. Filed PR5719.
Failures during template instantiation of the signature of a function
or function template have wrong point-of-instantiation location
information. I'll tackle that with a separate commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/TypePrinter.cpp')
-rw-r--r-- | lib/AST/TypePrinter.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index 2f58ebed4b..4a2b956172 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -285,6 +285,23 @@ void TypePrinter::PrintFunctionProto(const FunctionProtoType *T, } S += ")"; + + if (T->hasExceptionSpec()) { + S += " throw("; + if (T->hasAnyExceptionSpec()) + S += "..."; + else + for (unsigned I = 0, N = T->getNumExceptions(); I != N; ++I) { + if (I) + S += ", "; + + std::string ExceptionType; + Print(T->getExceptionType(I), ExceptionType); + S += ExceptionType; + } + S += ")"; + } + if (T->getNoReturnAttr()) S += " __attribute__((noreturn))"; Print(T->getResultType(), S); |