aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2020-12-14 13:08:48 +0100
committerJan Svoboda <jan_svoboda@apple.com>2020-12-15 10:15:58 +0100
commitf24e58df7ddf2dc9f13c8f8fc259f0374f04aca3 (patch)
treee88db4db63775d3b8b6824a7ffde50e2830607e0 /clang/lib/CodeGen/CGException.cpp
parent9c328e7afafd15795fed54e3b0c1c5bd4fa97dfa (diff)
downloadllvm-f24e58df7ddf2dc9f13c8f8fc259f0374f04aca3.zip
llvm-f24e58df7ddf2dc9f13c8f8fc259f0374f04aca3.tar.gz
llvm-f24e58df7ddf2dc9f13c8f8fc259f0374f04aca3.tar.bz2
[clang][cli] Create accessors for exception models in LangOptions
This abstracts away the members that are being replaced in a follow-up patch. Depends on D83979. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D93214
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 85604cf..f8a4869 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -121,11 +121,11 @@ static const EHPersonality &getCPersonality(const TargetInfo &Target,
const llvm::Triple &T = Target.getTriple();
if (T.isWindowsMSVCEnvironment())
return EHPersonality::MSVC_CxxFrameHandler3;
- if (L.SjLjExceptions)
+ if (L.hasSjLjExceptions())
return EHPersonality::GNU_C_SJLJ;
- if (L.DWARFExceptions)
+ if (L.hasDWARFExceptions())
return EHPersonality::GNU_C;
- if (L.SEHExceptions)
+ if (L.hasSEHExceptions())
return EHPersonality::GNU_C_SEH;
return EHPersonality::GNU_C;
}
@@ -149,9 +149,9 @@ static const EHPersonality &getObjCPersonality(const TargetInfo &Target,
LLVM_FALLTHROUGH;
case ObjCRuntime::GCC:
case ObjCRuntime::ObjFW:
- if (L.SjLjExceptions)
+ if (L.hasSjLjExceptions())
return EHPersonality::GNU_ObjC_SJLJ;
- if (L.SEHExceptions)
+ if (L.hasSEHExceptions())
return EHPersonality::GNU_ObjC_SEH;
return EHPersonality::GNU_ObjC;
}
@@ -165,13 +165,13 @@ static const EHPersonality &getCXXPersonality(const TargetInfo &Target,
return EHPersonality::MSVC_CxxFrameHandler3;
if (T.isOSAIX())
return EHPersonality::XL_CPlusPlus;
- if (L.SjLjExceptions)
+ if (L.hasSjLjExceptions())
return EHPersonality::GNU_CPlusPlus_SJLJ;
- if (L.DWARFExceptions)
+ if (L.hasDWARFExceptions())
return EHPersonality::GNU_CPlusPlus;
- if (L.SEHExceptions)
+ if (L.hasSEHExceptions())
return EHPersonality::GNU_CPlusPlus_SEH;
- if (L.WasmExceptions)
+ if (L.hasWasmExceptions())
return EHPersonality::GNU_Wasm_CPlusPlus;
return EHPersonality::GNU_CPlusPlus;
}
@@ -476,7 +476,7 @@ void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
// In wasm we currently treat 'throw()' in the same way as 'noexcept'. In
// case of throw with types, we ignore it and print a warning for now.
// TODO Correctly handle exception specification in wasm
- if (CGM.getLangOpts().WasmExceptions) {
+ if (CGM.getLangOpts().hasWasmExceptions()) {
if (EST == EST_DynamicNone)
EHStack.pushTerminate();
else
@@ -564,7 +564,7 @@ void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
// In wasm we currently treat 'throw()' in the same way as 'noexcept'. In
// case of throw with types, we ignore it and print a warning for now.
// TODO Correctly handle exception specification in wasm
- if (CGM.getLangOpts().WasmExceptions) {
+ if (CGM.getLangOpts().hasWasmExceptions()) {
if (EST == EST_DynamicNone)
EHStack.popTerminate();
return;