[PATCH] D20687: Update hasDynamicExceptionSpec to use functionType instead of functionDecl.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 5 10:05:40 PDT 2016


aaron.ballman requested changes to this revision.
aaron.ballman added a comment.
This revision now requires changes to proceed.

Sorry for the delayed response, this review got lost in my inbox!

This change will break existing out-of-tree users and would be a regression. Instead, the matcher should become a polymorphic matcher that accepts a FunctionDecl as well as a FunctionType. Check out the matcher for isConstexpr() to see how to create a polymorphic matcher. Note that you may need to use a trick like the one used in hasAnySubstatement() to handle the differences between getting the exception spec from a FunctionDecl and a FunctionType from the same matcher.

Also, can you update isNoThrow() at the same time? It has the similar behavior of currently working only on a FunctionDecl and not a FunctionType.

Finally, I'm wondering whether we want this to work on a FunctionType or a FunctionProtoType. Only functions with prototypes can have an exception specification, so putting the functionality on FunctionProtoType keeps it closer to the AST representation. However, this also may make it slightly more awkward to use in practice. Thoughts?


http://reviews.llvm.org/D20687





More information about the cfe-commits mailing list