I think having diagnostics interface similar to Clang's would be good. I think the total number of defined warnings would be much smaller than Clang. On Mon, Oct 7, 2013 at 3:19 PM, Shankar Easwaran <shankare at codeaurora.org>wrote:> Ping ? > > > On 10/4/2013 10:41 PM, Shankar Easwaran wrote: > >> Hi, >> >> lld doesnot have a Diagnostics interface, It uses llvm::errs() to display >> errors after linking has been done. >> >> I think the Diagnostics interface follow similiar interface patterns as >> followed by clang (using Diagnostic td files). >> >> What do you think ? >> >> Thanks >> >> Shankar Easwaran >> >> > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by the Linux Foundation > > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131007/219957ae/attachment.html>
On Mon, Oct 7, 2013 at 3:36 PM, Rui Ueyama <ruiu at google.com> wrote:> I think having diagnostics interface similar to Clang's would be good.Much like the options library, it has been a long-term desire to refactor all of the Clang diagnostics infrastructure into a largely independent library that could be used by lots of different tools, Clang, LLD, and even some internal tools that would benefit from improved diagnostic interfaces. There is already a heavy similarity between the LLVM diagnostic interfaces and Clangs, so this might not be completely unreasonable, but it is a really significant undertaking. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131007/52db1658/attachment.html>
I think we need a straw man proposal to start iterating on. Clang’s diagnostics has lots of good features. But is has lots that a linker does not need. For instance, the line/column number does not make sense for a linker. Clang errors/warnings are mostly about the source language which is pretty standard across different platforms. Other than multiple-defined and undefined errors, most of the linker errors and warnings will be platform specific. Linker warnings and errors are also historically very cryptic. Linker errors usually have a low level cause, and a high level action for the developer to take to resolve the issue. For instance, the low level trigger would be a particular relocation kind is not expected. The high level fix is to change the compiler options (e.g. -fno-pic) for a particular file. It would be nice to capture the low and high level in lld’s diagnostics. -Nick On Oct 7, 2013, at 3:36 PM, Rui Ueyama <ruiu at google.com> wrote:> I think having diagnostics interface similar to Clang's would be good. I think the total number of defined warnings would be much smaller than Clang. > > On Mon, Oct 7, 2013 at 3:19 PM, Shankar Easwaran <shankare at codeaurora.org> wrote: > Ping ? > > > On 10/4/2013 10:41 PM, Shankar Easwaran wrote: > Hi, > > lld doesnot have a Diagnostics interface, It uses llvm::errs() to display errors after linking has been done. > > I think the Diagnostics interface follow similiar interface patterns as followed by clang (using Diagnostic td files). > > What do you think ? > > Thanks > > Shankar Easwaran > > > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation > > _______________________________________________ > 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/20131007/9c3d1ebb/attachment.html>
On Mon, Oct 7, 2013 at 4:02 PM, Nick Kledzik <kledzik at apple.com> wrote:> But is has lots that a linker does not need. For instance, the > line/column number does not make sense for a linker. >Really? Gold has errors that mention lines and columns. It gets them by querying the debug information for file, line, and column. There may be examples of this, but I don't think source location is one of them.> Clang errors/warnings are mostly about the source language which is pretty > standard across different platforms. Other than multiple-defined and > undefined errors, most of the linker errors and warnings will be platform > specific. >I don't think this difference is significant. There are a enough platform specific warnings in Clang (at-exit and destructor handling) for us to have some need of machinery here. I suspect that the bigger difference is the object file format differences (ELF vs. Mach-O vs. COFF), but that seems not substantially different from language differences (C89, C99, C++, ObjC).> Linker warnings and errors are also historically very cryptic. Linker > errors usually have a low level cause, and a high level action for the > developer to take to resolve the issue. For instance, the low level > trigger would be a particular relocation kind is not expected. The high > level fix is to change the compiler options (e.g. -fno-pic) for a > particular file. It would be nice to capture the low and high level in > lld’s diagnostics. >Very much so. We've also had some great experience using debug info (when present) to produce much more detailed and user-friendly diagnostics in the linker. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131007/496f7e2f/attachment.html>
On Mon, Oct 7, 2013 at 7:02 PM, Nick Kledzik <kledzik at apple.com> wrote:> I think we need a straw man proposal to start iterating on. Clang’s > diagnostics has lots of good features. But is has lots that a linker does > not need. For instance, the line/column number does not make sense for a > linker. >Linker scripts will need this (although we still don't really have a good idea of how to fully integrate the necessary subset of linker script functionality into LLD, and it's not clear when that will become a priority). -- Sean Silva> Clang errors/warnings are mostly about the source language which is pretty > standard across different platforms. Other than multiple-defined and > undefined errors, most of the linker errors and warnings will be platform > specific. > > Linker warnings and errors are also historically very cryptic. Linker > errors usually have a low level cause, and a high level action for the > developer to take to resolve the issue. For instance, the low level > trigger would be a particular relocation kind is not expected. The high > level fix is to change the compiler options (e.g. -fno-pic) for a > particular file. It would be nice to capture the low and high level in > lld’s diagnostics. > > -Nick > > > On Oct 7, 2013, at 3:36 PM, Rui Ueyama <ruiu at google.com> wrote: > > I think having diagnostics interface similar to Clang's would be good. I > think the total number of defined warnings would be much smaller than Clang. > > On Mon, Oct 7, 2013 at 3:19 PM, Shankar Easwaran <shankare at codeaurora.org>wrote: > >> Ping ? >> >> >> On 10/4/2013 10:41 PM, Shankar Easwaran wrote: >> >>> Hi, >>> >>> lld doesnot have a Diagnostics interface, It uses llvm::errs() to >>> display errors after linking has been done. >>> >>> I think the Diagnostics interface follow similiar interface patterns as >>> followed by clang (using Diagnostic td files). >>> >>> What do you think ? >>> >>> Thanks >>> >>> Shankar Easwaran >>> >>> >> >> -- >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted >> by the Linux Foundation >> >> ______________________________**_________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >> > > > > _______________________________________________ > 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/20131007/d3ec7a20/attachment.html>
Are there any documents that cover the porting/usage of the diagnostic td file across other llvm tools. This might be useful. Thanks Shankar Easwaran On 10/7/2013 5:59 PM, Chandler Carruth wrote:> On Mon, Oct 7, 2013 at 3:36 PM, Rui Ueyama <ruiu at google.com> wrote: > >> I think having diagnostics interface similar to Clang's would be good. > > Much like the options library, it has been a long-term desire to refactor > all of the Clang diagnostics infrastructure into a largely independent > library that could be used by lots of different tools, Clang, LLD, and even > some internal tools that would benefit from improved diagnostic interfaces. > > There is already a heavy similarity between the LLVM diagnostic interfaces > and Clangs, so this might not be completely unreasonable, but it is a > really significant undertaking. >-- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation