[llvm] r203009 - Improve LinkModules warnings
Rafael EspĂndola
rafael.espindola at gmail.com
Fri Mar 7 15:26:31 PST 2014
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
More information about the llvm-commits
mailing list