summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/Linker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-22 19:13:20 +0000
committerChris Lattner <sabre@nondot.org>2003-04-22 19:13:20 +0000
commitc6ce4dafbe6074251728608bff0404a26e338526 (patch)
tree33b4605cddfa015aeea90e059e97fd6bb4ab67d1 /llvm/lib/Transforms/Utils/Linker.cpp
parentc840aa64e2fb306d2f72c41256583d47f3904c53 (diff)
downloadbcm5719-llvm-c6ce4dafbe6074251728608bff0404a26e338526.tar.gz
bcm5719-llvm-c6ce4dafbe6074251728608bff0404a26e338526.zip
Add warning when linking modules with disagreeing target properties
llvm-svn: 5845
Diffstat (limited to 'llvm/lib/Transforms/Utils/Linker.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Linker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Linker.cpp b/llvm/lib/Transforms/Utils/Linker.cpp
index 65b05cd65e9..b5cec060763 100644
--- a/llvm/lib/Transforms/Utils/Linker.cpp
+++ b/llvm/lib/Transforms/Utils/Linker.cpp
@@ -469,6 +469,10 @@ static bool LinkFunctionBodies(Module *Dest, const Module *Src,
// shouldn't be relied on to be consistent.
//
bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
+ if (Dest->getEndianness() != Src->getEndianness())
+ std::cerr << "WARNING: Linking two modules of different endianness!\n";
+ if (Dest->getPointerSize() != Src->getPointerSize())
+ std::cerr << "WARNING: Linking two modules of different pointer size!\n";
// LinkTypes - Go through the symbol table of the Src module and see if any
// types are named in the src module that are not named in the Dst module.
OpenPOWER on IntegriCloud