summaryrefslogtreecommitdiffstats
path: root/include/clang/CodeGen/CGFunctionInfo.h
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2015-11-23 22:04:44 +0000
committerSamuel Antao <sfantao@us.ibm.com>2015-11-23 22:04:44 +0000
commit0cb5f3abb0de5d03e98e87256a3f369ad2a0e205 (patch)
treef23d98402e4b357d568f8edcf6da172ca39653e1 /include/clang/CodeGen/CGFunctionInfo.h
parentaffe30e522ba1f222a8c4f634655e75f93ea2bb8 (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.h23
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