[llvm] r265815 - [Object] Report an error if .alt_entry is used with ELF or COFF.
Rafael EspĂndola via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 10 08:35:57 PDT 2016
Thanks, but:
* This should have a testcase.
* It is odd to parse and then issue an error. I think the correct fix
is to move the parsing to lib/MC/MCParser/DarwinAsmParser.cpp, that
way we get the natural error on ELF and COFF.
Cheers,
Rafael
On 8 April 2016 at 13:38, Lang Hames via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: lhames
> Date: Fri Apr 8 12:38:51 2016
> New Revision: 265815
>
> URL: http://llvm.org/viewvc/llvm-project?rev=265815&view=rev
> Log:
> [Object] Report an error if .alt_entry is used with ELF or COFF.
>
> I'm looking into a better way to do this long-term, but for now at least don't
> crash.
>
> Modified:
> llvm/trunk/lib/MC/MCELFStreamer.cpp
> llvm/trunk/lib/MC/WinCOFFStreamer.cpp
>
> Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=265815&r1=265814&r2=265815&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/MCELFStreamer.cpp Fri Apr 8 12:38:51 2016
> @@ -285,7 +285,7 @@ bool MCELFStreamer::EmitSymbolAttribute(
> break;
>
> case MCSA_AltEntry:
> - llvm_unreachable("ELF doesn't support this attribute");
> + report_fatal_error("ELF doesn't support the .alt_entry attribute");
> }
>
> return true;
>
> Modified: llvm/trunk/lib/MC/WinCOFFStreamer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WinCOFFStreamer.cpp?rev=265815&r1=265814&r2=265815&view=diff
> ==============================================================================
> --- llvm/trunk/lib/MC/WinCOFFStreamer.cpp (original)
> +++ llvm/trunk/lib/MC/WinCOFFStreamer.cpp Fri Apr 8 12:38:51 2016
> @@ -107,6 +107,8 @@ bool MCWinCOFFStreamer::EmitSymbolAttrib
> case MCSA_Global:
> Symbol->setExternal(true);
> break;
> + case MCSA_AltEntry:
> + report_fatal_error("COFF doesn't support the .alt_entry attribute");
> }
>
> return true;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list