From a797ee0210902669833720f9df7c3be5e58c1401 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 30 Dec 2010 02:49:45 +0000 Subject: [PATCH] include the module identifier when emitting this warning, PR8865. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122637 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkModules.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index 025aec99572..d99e0a06b67 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -1218,10 +1218,13 @@ Linker::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) { Src->getDataLayout() != Dest->getDataLayout()) errs() << "WARNING: Linking two modules of different data layouts!\n"; if (!Src->getTargetTriple().empty() && - Dest->getTargetTriple() != Src->getTargetTriple()) - errs() << "WARNING: Linking two modules of different target triples: '" - << Src->getTargetTriple() << "' and '" << Dest->getTargetTriple() - << "'\n"; + Dest->getTargetTriple() != Src->getTargetTriple()) { + errs() << "WARNING: Linking two modules of different target triples: "; + if (!Src->getModuleIdentifier().empty()) + errs() << Src->getModuleIdentifier() << ": "; + errs() << "'" << Src->getTargetTriple() << "' and '" + << Dest->getTargetTriple() << "'\n"; + } // Append the module inline asm string. if (!Src->getModuleInlineAsm().empty()) {