clang API Documentation
00001 //===-- CGException.h - Classes for exceptions IR generation ----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // These classes support the generation of LLVM IR for exceptions in 00011 // C++ and Objective C. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef CLANG_CODEGEN_CGEXCEPTION_H 00016 #define CLANG_CODEGEN_CGEXCEPTION_H 00017 00018 #include "llvm/ADT/StringRef.h" 00019 00020 namespace clang { 00021 class LangOptions; 00022 00023 namespace CodeGen { 00024 00025 /// The exceptions personality for a function. When 00026 class EHPersonality { 00027 StringRef PersonalityFn; 00028 00029 // If this is non-null, this personality requires a non-standard 00030 // function for rethrowing an exception after a catchall cleanup. 00031 // This function must have prototype void(void*). 00032 StringRef CatchallRethrowFn; 00033 00034 EHPersonality(StringRef PersonalityFn, 00035 StringRef CatchallRethrowFn = StringRef()) 00036 : PersonalityFn(PersonalityFn), 00037 CatchallRethrowFn(CatchallRethrowFn) {} 00038 00039 public: 00040 static const EHPersonality &get(const LangOptions &Lang); 00041 static const EHPersonality GNU_C; 00042 static const EHPersonality GNU_C_SJLJ; 00043 static const EHPersonality GNU_ObjC; 00044 static const EHPersonality GNU_ObjCXX; 00045 static const EHPersonality NeXT_ObjC; 00046 static const EHPersonality GNU_CPlusPlus; 00047 static const EHPersonality GNU_CPlusPlus_SJLJ; 00048 00049 StringRef getPersonalityFnName() const { return PersonalityFn; } 00050 StringRef getCatchallRethrowFnName() const { return CatchallRethrowFn; } 00051 }; 00052 00053 } 00054 } 00055 00056 #endif