[cfe-commits] r139514 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Douglas Gregor dgregor at apple.com
Mon Sep 12 11:31:32 PDT 2011


On Sep 12, 2011, at 11:24 AM, Devang Patel wrote:

> Author: dpatel
> Date: Mon Sep 12 13:24:46 2011
> New Revision: 139514
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=139514&view=rev
> Log:
> Add an assert so that new builtins do not sneak without proper debug info.
> 
> Modified:
>    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=139514&r1=139513&r2=139514&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Sep 12 13:24:46 2011
> @@ -290,6 +290,8 @@
>   const char *BTName = NULL;
>   switch (BT->getKind()) {
>   default:
> +    assert(0 && "Unexpected builtin");
> +    return llvm::DIType();

Please just drop the default case entirely. That way, we'll get a warning if any of the built-ins are unhanded, which is far better than a run-time assertion.

	- Doug



More information about the cfe-commits mailing list