diff options
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r-- | llvm/lib/IR/DataLayout.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp index 7089b7b85ff..162f3d3ac37 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) { |