[llvm] r203009 - Improve LinkModules warnings

JF Bastien jfb at google.com
Sat Mar 8 09:18:40 PST 2014


I added a triple test:

http://llvm-reviews.chandlerc.com/D3014

Datalayout is already tested.


On Fri, Mar 7, 2014 at 3:26 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com
> wrote:

> Thanks. Can you add a testcase?
>
> On 5 March 2014 16:26, JF Bastien <jfb at google.com> wrote:
> > Author: jfb
> > Date: Wed Mar  5 15:26:42 2014
> > New Revision: 203009
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=203009&view=rev
> > Log:
> > Improve LinkModules warnings
> >
> > Provide triple and data layout as well as module names (or empty string)
> when there's a mismatch.
> >
> > Differential Revision: http://llvm-reviews.chandlerc.com/D2971
> >
> > Modified:
> >     llvm/trunk/lib/Linker/LinkModules.cpp
> >
> > Modified: llvm/trunk/lib/Linker/LinkModules.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=203009&r1=203008&r2=203009&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/Linker/LinkModules.cpp (original)
> > +++ llvm/trunk/lib/Linker/LinkModules.cpp Wed Mar  5 15:26:42 2014
> > @@ -1210,16 +1210,20 @@ bool ModuleLinker::run() {
> >    if (SrcM->getDataLayout() && DstM->getDataLayout() &&
> >        *SrcM->getDataLayout() != *DstM->getDataLayout()) {
> >      if (!SuppressWarnings) {
> > -      errs() << "WARNING: Linking two modules of different data
> layouts!\n";
> > +      errs() << "WARNING: Linking two modules of different data
> layouts: '"
> > +             << SrcM->getModuleIdentifier() << "' is '"
> > +             << SrcM->getDataLayoutStr() << "' whereas '"
> > +             << DstM->getModuleIdentifier() << "' is '"
> > +             << DstM->getDataLayoutStr() << "'\n";
> >      }
> >    }
> >    if (!SrcM->getTargetTriple().empty() &&
> >        DstM->getTargetTriple() != SrcM->getTargetTriple()) {
> >      if (!SuppressWarnings) {
> > -      errs() << "WARNING: Linking two modules of different target
> triples: ";
> > -      if (!SrcM->getModuleIdentifier().empty())
> > -        errs() << SrcM->getModuleIdentifier() << ": ";
> > -      errs() << "'" << SrcM->getTargetTriple() << "' and '"
> > +      errs() << "WARNING: Linking two modules of different target
> triples: "
> > +             << SrcM->getModuleIdentifier() << "' is '"
> > +             << SrcM->getTargetTriple() << "' whereas '"
> > +             << DstM->getModuleIdentifier() << "' is '"
> >               << DstM->getTargetTriple() << "'\n";
> >      }
> >    }
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140308/88693aed/attachment.html>


More information about the llvm-commits mailing list