diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index 7089b7b..162f3d3 100644 --- a/llvm/lib/IR/DataLayout.cpp +++ b/llvm/lib/IR/DataLayout.cpp @@ -354,6 +354,16 @@ DataLayout::DataLayout(const Module *M) : LayoutMap(0) { reset(""); } +bool DataLayout::operator==(const DataLayout &Other) const { + bool Ret = LittleEndian == Other.LittleEndian && + StackNaturalAlign == Other.StackNaturalAlign && + ManglingMode == Other.ManglingMode && + LegalIntWidths == Other.LegalIntWidths && + Alignments == Other.Alignments && Pointers == Pointers; + assert(Ret == (getStringRepresentation() == Other.getStringRepresentation())); + return Ret; +} + void DataLayout::setAlignment(AlignTypeEnum align_type, unsigned abi_align, unsigned pref_align, uint32_t bit_width) { diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index f1b8cb7..9160e26 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -1208,7 +1208,7 @@ bool ModuleLinker::run() { DstM->setTargetTriple(SrcM->getTargetTriple()); if (SrcM->getDataLayout() && DstM->getDataLayout() && - SrcM->getDataLayout() != DstM->getDataLayout()) { + *SrcM->getDataLayout() != *DstM->getDataLayout()) { if (!SuppressWarnings) { errs() << "WARNING: Linking two modules of different data layouts!\n"; } |