aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
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
commit43a9994c0164848d44527060da72985c75183a48 (patch)
tree72bd64dee9f8a5209f50ef8ba7a80ec2051f838c /lib/VMCore
parent61a909a6fd618a17f9d28f5ab2237f7fb179f8a8 (diff)
downloadexternal_llvm-43a9994c0164848d44527060da72985c75183a48.zip
external_llvm-43a9994c0164848d44527060da72985c75183a48.tar.gz
external_llvm-43a9994c0164848d44527060da72985c75183a48.tar.bz2
Add warning when linking modules with disagreeing target properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Linker.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index 65b05cd..b5cec06 100644
--- a/lib/VMCore/Linker.cpp
+++ b/lib/VMCore/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.