For a target that hasn't implemented branch relaxation (yet), does anyone know what is the preferred way to report an error if a fixup cannot be applied because, for example, the destination of a branch is out of range? I suppose I could use asserts just like AArch64 is doing but that won't stop the assembler of emitting a branch to an undesired location in release builds. Does anyone see any problem in using report_fatal_error to report errors in the target Asm backend ? Regards, Matheus Matheus Almeida MIPS processor IP www.imgtec.com<http://www.imgtec.com/> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131203/0be6607c/attachment.html>
Matheus, The ARM backend reports these kinds of errors using FatalError method of MCContext. You can see some examples in ARMAsmBackend.cpp (search for "out of range pc-relative fixup value"). -David From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Matheus Almeida Sent: Tuesday, December 03, 2013 5:37 AM To: llvmdev at cs.uiuc.edu Subject: [LLVMdev] Reporting errors when applying fixups For a target that hasn't implemented branch relaxation (yet), does anyone know what is the preferred way to report an error if a fixup cannot be applied because, for example, the destination of a branch is out of range? I suppose I could use asserts just like AArch64 is doing but that won't stop the assembler of emitting a branch to an undesired location in release builds. Does anyone see any problem in using report_fatal_error to report errors in the target Asm backend ? Regards, Matheus Matheus Almeida MIPS processor IP <http://www.imgtec.com/> www.imgtec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131203/97693751/attachment.html>
Yup, that’s the best option available right now. There’s limited support for adding a source location to the fixups so the diagnostic isn’t completely useless when coming from the assembler. There’s a proposal ongoing about improved diagnostics from the backend that Quentin is working on that will help here when it’s completed. -Jim On Dec 3, 2013, at 9:51 AM, David Peixotto <dpeixott at codeaurora.org> wrote:> Matheus, > > The ARM backend reports these kinds of errors using FatalError method of MCContext. You can see some examples in ARMAsmBackend.cpp (search for "out of range pc-relative fixup value"). > > -David > > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Matheus Almeida > Sent: Tuesday, December 03, 2013 5:37 AM > To: llvmdev at cs.uiuc.edu > Subject: [LLVMdev] Reporting errors when applying fixups > > For a target that hasn’t implemented branch relaxation (yet), does anyone know what is the preferred way to report an error if a fixup cannot be applied because, for example, the destination of a branch is out of range? > I suppose I could use asserts just like AArch64 is doing but that won’t stop the assembler of emitting a branch to an undesired location in release builds. > Does anyone see any problem in using report_fatal_error to report errors in the target Asm backend ? > > Regards, > Matheus > > Matheus Almeida > MIPS processor IP > www.imgtec.com > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131203/c137cf7e/attachment.html>
Possibly Parallel Threads
- [LLVMdev] Reporting errors when applying fixups
- [LLVMdev] Target Assembly Parser: Access to Reloc::Model
- [LLVMdev] Is there any tool can generate MIPS ELF file?
- [LLVMdev] Is there any tool can generate MIPS ELF file?
- [LLVMdev] Is there any tool can generate MIPS ELF file?