llvm.org GIT mirror llvm / 5cf1199
C++ify, add new get_cxx_exception function to convert from generic llvm_exceptions to llvm_cxx_exception's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8156 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
2 changed file(s) with 14 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
99
1010 #include "exception.h"
1111 #include
12 #include
1213
13 typedef struct llvm_cxx_exception {
14 struct llvm_cxx_exception {
1415 /* TypeInfo - A pointer to the C++ std::type_info object for this exception
1516 * class. This is required because the class may not be polymorphic.
1617 */
4142 * this structure without breaking binary compatibility.
4243 */
4344 llvm_exception BaseException;
44 } llvm_cxx_exception;
45 };
4546
46
47 inline llvm_cxx_exception *get_cxx_exception(llvm_exception *E) {
48 assert(E->ExceptionType == CXXException && "Not a C++ exception?");
49 return (llvm_cxx_exception*)(E+1)-1;
50 }
4751
4852 extern "C" {
4953 void *__llvm_cxxeh_allocate_exception(unsigned NumBytes);
99
1010 #include "exception.h"
1111 #include
12 #include
1213
13 typedef struct llvm_cxx_exception {
14 struct llvm_cxx_exception {
1415 /* TypeInfo - A pointer to the C++ std::type_info object for this exception
1516 * class. This is required because the class may not be polymorphic.
1617 */
4142 * this structure without breaking binary compatibility.
4243 */
4344 llvm_exception BaseException;
44 } llvm_cxx_exception;
45 };
4546
46
47 inline llvm_cxx_exception *get_cxx_exception(llvm_exception *E) {
48 assert(E->ExceptionType == CXXException && "Not a C++ exception?");
49 return (llvm_cxx_exception*)(E+1)-1;
50 }
4751
4852 extern "C" {
4953 void *__llvm_cxxeh_allocate_exception(unsigned NumBytes);