[PATCH] Initial SEH IR generation implementation
John McCall
rjmccall at gmail.com
Fri Jan 16 02:28:39 PST 2015
================
Comment at: lib/CodeGen/CGException.cpp:1702
@@ +1701,3 @@
+llvm::Constant *
+CodeGenFunction::GenerateSEHFilterFunction() {
+ // Get the mangled function name.
----------------
Can you at least document what the point of this is?
================
Comment at: lib/CodeGen/CGException.cpp:1772
@@ +1771,3 @@
+
+ if (SEHFinallyStmt *Finally = S.getFinallyHandler()) {
+ // SEH cleanups should be simple.
----------------
Doesn't the finally handler need to be active within the catch handler? You probably need to push it first.
================
Comment at: lib/CodeGen/CGException.cpp:1821
@@ +1820,3 @@
+ }
+ Builder.CreateCall(FilterIntrin, R);
+
----------------
Shouldn't you be branching on the filter result or something? It feels wrong for the control flow here to be implicit.
================
Comment at: lib/CodeGen/CGException.cpp:1830
@@ +1829,3 @@
+ }
+
+ if (SEHFinallyStmt *Finally = S.getFinallyHandler()) {
----------------
Yeah, you're popping it after you pop the catch. That can't possibly work if you pushed the catch first.
This also suggests that you aren't testing that adequately. :)
================
Comment at: lib/Sema/SemaChecking.cpp:467
@@ +466,3 @@
+ case Builtin::BI_exception_code: {
+ Scope *S = getCurScope();
+ while (S && !S->isSEHExceptScope())
----------------
This checking can run in template instantiations, but getCurScope() isn't meaningful there.
http://reviews.llvm.org/D5607
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list