Implement: Linker/2003-08-24-InheritPtrSize.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8129 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-08-24 19:26:42 +00:00
parent f687adae9b
commit 873c5e7859
3 changed files with 27 additions and 6 deletions

View File

@ -761,9 +761,16 @@ static bool LinkAppendingVars(Module *M,
// 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

View File

@ -761,9 +761,16 @@ static bool LinkAppendingVars(Module *M,
// 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

View File

@ -761,9 +761,16 @@ static bool LinkAppendingVars(Module *M,
// 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