Closed GoogleCodeExporter closed 9 years ago
Both MSVC and GCC seem happy with this.
Have you considered using llvm_unreachable? I think CHECK_ has the same effect,
but it could be that the unconditional llvm_unreachable lets you remove the
bogus return values. See uses of llvm_unreachable in the Clang codebase.
This looks good to me as-is, but I think it'd be even nicer with
llvm_unreachable.
Original comment by kim.gras...@gmail.com
on 30 Dec 2013 at 4:19
-Wcovered-switch-default and llvm_unreachable occur sometimes together, but are
independent. So I've committed warning fix to avoid mixing everything together
in a single commit. As for llvm_unreachable see attached patch.
I've considered using llvm_unreachable as is, but CHECK_ assertions aren't
disabled in Release build and I don't want CHECK_ and llvm_unreachable
assertions to behave differently in Debug and Release. Also CHECK_ returns a
stream but llvm_unreachable doesn't. That's why I've introduced
CHECK_UNREACHABLE_ making ~FatalMessageEmitter() more like
llvm::llvm_unreachable_internal() (from "llvm/Support/ErrorHandling.h"). What
do you think, Kim?
Original comment by vsap...@gmail.com
on 30 Dec 2013 at 8:24
Attachments:
Looks good! I tested on MSVC; built and ran fine.
Original comment by kim.gras...@gmail.com
on 30 Dec 2013 at 8:59
Thanks Kim for the help.
Original comment by vsap...@gmail.com
on 31 Dec 2013 at 4:19
Original issue reported on code.google.com by
vsap...@gmail.com
on 30 Dec 2013 at 3:53Attachments: