[PATCH] RE: [cfe-dev] missing return statement for non-void functions in C++

scott douglass via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 18 06:16:17 PDT 2015


> Please see updated patch file attached, which now includes a fixed/added
> regression test.

I think it's a good idea; two minor remarks:

+    if (!CGM.getCodeGenOpts().OptimizeSize) {
Should this be 'else if'?  I imagine there's no use emitting a trap after the sanitizer has emitted a missing_return check.

In the regression test, the CHECK-OPT case is now essentially the same as the CHECK case, so remove ' --check-prefix=CHECK-OPT' (but leave the RUN:) and these lines
  // CHECK-OPT: call void @llvm.trap
  // CHECK-OPT:     unreachable





More information about the cfe-commits mailing list