diff options
author | Samuel Antao <sfantao@us.ibm.com> | 2015-11-23 22:04:44 +0000 |
---|---|---|
committer | Samuel Antao <sfantao@us.ibm.com> | 2015-11-23 22:04:44 +0000 |
commit | 0cb5f3abb0de5d03e98e87256a3f369ad2a0e205 (patch) | |
tree | f23d98402e4b357d568f8edcf6da172ca39653e1 /include/clang/CodeGen/CGFunctionInfo.h | |
parent | affe30e522ba1f222a8c4f634655e75f93ea2bb8 (diff) |
Preserve exceptions information during calls code generation.
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/CodeGen/CGFunctionInfo.h')
-rw-r--r-- | include/clang/CodeGen/CGFunctionInfo.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h index a3ce8c2b9f..bb6ceb4351 100644 --- a/include/clang/CodeGen/CGFunctionInfo.h +++ b/include/clang/CodeGen/CGFunctionInfo.h @@ -509,6 +509,29 @@ public: } }; +/// CGCalleeInfo - Class to encapsulate the information about a callee to be +/// used during the generation of call/invoke instructions. +class CGCalleeInfo { + /// \brief The function proto type of the callee. + const FunctionProtoType *CalleeProtoTy; + /// \brief The function declaration of the callee. + const Decl *CalleeDecl; + +public: + explicit CGCalleeInfo() : CalleeProtoTy(nullptr), CalleeDecl(nullptr) {} + CGCalleeInfo(const FunctionProtoType *calleeProtoTy, const Decl *calleeDecl) + : CalleeProtoTy(calleeProtoTy), CalleeDecl(calleeDecl) {} + CGCalleeInfo(const FunctionProtoType *calleeProtoTy) + : CalleeProtoTy(calleeProtoTy), CalleeDecl(nullptr) {} + CGCalleeInfo(const Decl *calleeDecl) + : CalleeProtoTy(nullptr), CalleeDecl(calleeDecl) {} + + const FunctionProtoType *getCalleeFunctionProtoType() { + return CalleeProtoTy; + } + const Decl *getCalleeDecl() { return CalleeDecl; } +}; + } // end namespace CodeGen } // end namespace clang |