[PATCH] D14796: Preserve exceptions information during calls code generation.

Samuel Antao via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 18 16:51:13 PST 2015


sfantao created this revision.
sfantao added reviewers: rjmccall, rnk, ABataev, hfinkel.
sfantao added a subscriber: cfe-commits.

This patch changes the generation of `CGFunctionInfo` to contain the `FunctionProtoType` if it is available. This enables the code generation for call instructions to look into this type for exception information and therefore generate better quality IR - it will not create invoke instructions for functions that are know not to throw.

The emission code had to be changed in a few places to keep the `FunctionProtoType` and, namely for the complex arithmetic library calls, create new `FunctionProtoType`s with the right exception information.

This patch is just a first step to have more accurate IR, as there may be other patterns that could take advantage of extra information. I'm just covering some cases I am aware of.

Thanks!
Samuel 

http://reviews.llvm.org/D14796

Files:
  include/clang/CodeGen/CGFunctionInfo.h
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CGExprComplex.cpp
  lib/CodeGen/CodeGenTypes.h
  test/CodeGenCXX/observe-noexcept.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14796.40579.patch
Type: text/x-patch
Size: 16912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20151119/fba2d8dc/attachment-0001.bin>


More information about the cfe-commits mailing list