Add warning when linking modules with disagreeing target properties
authorChris Lattner <sabre@nondot.org>
Tue, 22 Apr 2003 19:13:20 +0000 (19:13 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 22 Apr 2003 19:13:20 +0000 (19:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5845 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Linker/LinkModules.cpp
lib/Transforms/Utils/Linker.cpp
lib/VMCore/Linker.cpp

index 65b05cd65e95af90e0abd5d5fea9fc85f85a8984..b5cec060763206c1fc0c158f96aa2705e973fde7 100644 (file)
@@ -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.
index 65b05cd65e95af90e0abd5d5fea9fc85f85a8984..b5cec060763206c1fc0c158f96aa2705e973fde7 100644 (file)
@@ -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.
index 65b05cd65e95af90e0abd5d5fea9fc85f85a8984..b5cec060763206c1fc0c158f96aa2705e973fde7 100644 (file)
@@ -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.