[llvm-commits] CVS: llvm/lib/Transforms/Utils/Linker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Aug 24 14:27:01 PDT 2003
Changes in directory llvm/lib/Transforms/Utils:
Linker.cpp updated: 1.51 -> 1.52
---
Log message:
Implement: Linker/2003-08-24-InheritPtrSize.ll
---
Diffs of the changes:
Index: llvm/lib/Transforms/Utils/Linker.cpp
diff -u llvm/lib/Transforms/Utils/Linker.cpp:1.51 llvm/lib/Transforms/Utils/Linker.cpp:1.52
--- llvm/lib/Transforms/Utils/Linker.cpp:1.51 Sat Aug 23 16:32:24 2003
+++ llvm/lib/Transforms/Utils/Linker.cpp Sun Aug 24 14:26:42 2003
@@ -761,9 +761,16 @@
// shouldn't be relied on to be consistent.
//
bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
- if (Dest->getEndianness() != Src->getEndianness())
+ if (Dest->getEndianness() == Module::AnyEndianness)
+ Dest->setEndianness(Src->getEndianness());
+ if (Dest->getPointerSize() == Module::AnyPointerSize)
+ Dest->setPointerSize(Src->getPointerSize());
+
+ if (Src->getEndianness() != Module::AnyEndianness &&
+ Dest->getEndianness() != Src->getEndianness())
std::cerr << "WARNING: Linking two modules of different endianness!\n";
- if (Dest->getPointerSize() != Src->getPointerSize())
+ if (Src->getPointerSize() != Module::AnyPointerSize &&
+ 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
More information about the llvm-commits
mailing list