1 //===-- CGException.h - Classes for exceptions IR generation ----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // These classes support the generation of LLVM IR for exceptions in
11 // C++ and Objective C.
13 //===----------------------------------------------------------------------===//
15 #ifndef CLANG_CODEGEN_CGEXCEPTION_H
16 #define CLANG_CODEGEN_CGEXCEPTION_H
18 #include "llvm/ADT/StringRef.h"
25 /// The exceptions personality for a function. When
27 StringRef PersonalityFn;
29 // If this is non-null, this personality requires a non-standard
30 // function for rethrowing an exception after a catchall cleanup.
31 // This function must have prototype void(void*).
32 StringRef CatchallRethrowFn;
34 EHPersonality(StringRef PersonalityFn,
35 StringRef CatchallRethrowFn = StringRef())
36 : PersonalityFn(PersonalityFn),
37 CatchallRethrowFn(CatchallRethrowFn) {}
40 static const EHPersonality &get(const LangOptions &Lang);
41 static const EHPersonality GNU_C;
42 static const EHPersonality GNU_C_SJLJ;
43 static const EHPersonality GNU_ObjC;
44 static const EHPersonality GNU_ObjCXX;
45 static const EHPersonality NeXT_ObjC;
46 static const EHPersonality GNU_CPlusPlus;
47 static const EHPersonality GNU_CPlusPlus_SJLJ;
49 StringRef getPersonalityFnName() const { return PersonalityFn; }
50 StringRef getCatchallRethrowFnName() const { return CatchallRethrowFn; }