Rafael Espindola | f230df9 | 2010-10-16 18:23:53 +0000 | [diff] [blame] | 1 | //===- lib/MC/MCObjectFormat.cpp - MCObjectFormat implementation ----------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "llvm/MC/MCObjectFormat.h" |
| 11 | #include "llvm/MC/MCSymbol.h" |
| 12 | |
| 13 | using namespace llvm; |
| 14 | |
Chandler Carruth | b5a2d3f | 2010-10-19 00:37:30 +0000 | [diff] [blame] | 15 | MCObjectFormat::~MCObjectFormat() { |
| 16 | } |
| 17 | |
Rafael Espindola | f230df9 | 2010-10-16 18:23:53 +0000 | [diff] [blame] | 18 | bool MCELFObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, |
| 19 | const MCSymbol &B) const { |
| 20 | // On ELF A - B is absolute if A and B are in the same section. |
| 21 | return &A.getSection() == &B.getSection(); |
| 22 | } |
| 23 | |
| 24 | bool MCMachOObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, |
| 25 | const MCSymbol &B) const { |
| 26 | // On MachO A - B is absolute only if in a set. |
| 27 | return IsSet; |
| 28 | } |
| 29 | |
| 30 | bool MCCOFFObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, |
| 31 | const MCSymbol &B) const { |
| 32 | // On COFF A - B is absolute if A and B are in the same section. |
| 33 | return &A.getSection() == &B.getSection(); |
| 34 | } |