[llvm-commits] [llvm] r81044 - /llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp
Török Edwin
edwintorok at gmail.com
Wed Sep 9 00:13:52 PDT 2009
On 2009-09-05 00:22, Andreas Neustifter wrote:
> Author: astifter
> Date: Fri Sep 4 16:22:04 2009
> New Revision: 81044
>
> URL: http://llvm.org/viewvc/llvm-project?rev=81044&view=rev
> Log:
> Prevent warnings on compilers for which its not clear that assert won't return.
>
> Modified:
> llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp
>
> Modified: llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp?rev=81044&r1=81043&r2=81044&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp (original)
> +++ llvm/trunk/lib/Analysis/ProfileVerifierPass.cpp Fri Sep 4 16:22:04 2009
> @@ -167,6 +167,7 @@
> return 0;
> } else {
> assert(0 && Message);
> + return 0;
>
Why not use llvm_unreachable(Message) from Support/ErrorHandling.h?
That prints the message to stderr, and calls abort, it is also marked as
noreturn.
It also works when NDEBUG is not defined: it prints a default error
message (UNREACHABLE executed) and calls abort.
Best regards,
--Edwin
More information about the llvm-commits
mailing list