[PATCH] DebugInfo: fix crash with null streamer

David Blaikie dblaikie at gmail.com
Mon Jun 16 10:53:16 PDT 2014


Perhaps the MCNullStreamer should provide a better stub for this
rather than returning zero?

Given that the null streamer produces no output (I guess that's what
it's for - I haven't used it personally) I don't suppose there's much
that can be feature tested other than "this does not crash".

It looks like you can invoke the null streamer in llc using
"-filetype=null" (I found this with some spelunking, following clang's
implementation of -emit-codegen-only down to the target layer
(CGFT_Null), then looking for that in LLVM utilities, etc...
eventually finding the cl::opt for "filetype" in
include/llvm/CodeGen/CommandFlags.h)

On Mon, Jun 16, 2014 at 10:13 AM, Alp Toker <alp at nuanti.com> wrote:
> The attached patch fixes crashes when emitting debug info with a
> MCNullStreamer.
>
> The only test case I could come up with uses clang's EmitBackendOutput in
> -emit-codegen-only mode to reproduce the crash:
>
>   echo 'void f() {}' | clang -cc1 - -gline-tables-only -emit-codegen-only
>
> I'm not familiar enough with backend debug testing info to pull together a
> standalone test. Suggestions welcome!
>
> Alp.
>
> --
> http://www.nuanti.com
> the browser experts
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list