rsmith added inline comments.

================
Comment at: clang/lib/CodeGen/CGExpr.cpp:4337
+        EmitCXXThrowExpr(ThrowExpr);
+        return EmitLValue(dead);
+      }
----------------
The IR we emit for the dead operand is unreachable; it's a bit wasteful to 
generate it here and (hopefully!) leave it to the optimizer to remove it again. 
Perhaps we could produce an `undef` lvalue instead? See 
`CodeGenFunction::EmitUnsupportedLValue` for an example of how to build such a 
value.


================
Comment at: clang/test/CodeGenCXX/throw-expressions.cpp:84-87
+  void conditional_throw() {
+    int a, b;
+    (true ? throw 0 : a) = 0;
+  }
----------------
Please add some `CHECK`s in here to make sure we actually emit a call to 
`__cxa_throw`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77502/new/

https://reviews.llvm.org/D77502



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to