diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-18 05:37:28 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-12-18 05:37:28 +0000 |
commit | 8396dd0893d5b0168cf66fd65108676c362f644c (patch) | |
tree | 22738b12f9bad5cec194023144fd1fa1d297ebb1 /llvm/lib/MC | |
parent | 1b47773e1fb6189c48e083a110274912218e8bcf (diff) | |
download | bcm5719-llvm-8396dd0893d5b0168cf66fd65108676c362f644c.tar.gz bcm5719-llvm-8396dd0893d5b0168cf66fd65108676c362f644c.zip |
Remove the MCObjectFormat class.
llvm-svn: 122147
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/CMakeLists.txt | 1 | ||||
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/MC/MCExpr.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/MC/MCObjectFormat.cpp | 34 | ||||
-rw-r--r-- | llvm/lib/MC/MachObjectWriter.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/MC/WinCOFFObjectWriter.cpp | 6 |
6 files changed, 20 insertions, 38 deletions
diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt index ccec2dc4267..c17e1505b09 100644 --- a/llvm/lib/MC/CMakeLists.txt +++ b/llvm/lib/MC/CMakeLists.txt @@ -20,7 +20,6 @@ add_llvm_library(LLVMMC MCMachObjectTargetWriter.cpp MCNullStreamer.cpp MCObjectStreamer.cpp - MCObjectFormat.cpp MCObjectWriter.cpp MCPureStreamer.cpp MCSection.cpp diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 10e67d20d5c..a6503b7cacb 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -352,6 +352,12 @@ namespace { return false; } + virtual bool isAbsolute(bool IsSet, const MCSymbol &A, + const MCSymbol &B) const { + // On ELF A - B is absolute if A and B are in the same section. + return &A.getSection() == &B.getSection(); + } + virtual bool IsFixupFullyResolved(const MCAssembler &Asm, const MCValue Target, bool IsPCRel, diff --git a/llvm/lib/MC/MCExpr.cpp b/llvm/lib/MC/MCExpr.cpp index 3533da2cf64..22d8740a197 100644 --- a/llvm/lib/MC/MCExpr.cpp +++ b/llvm/lib/MC/MCExpr.cpp @@ -14,7 +14,6 @@ #include "llvm/MC/MCAsmLayout.h" #include "llvm/MC/MCAssembler.h" #include "llvm/MC/MCContext.h" -#include "llvm/MC/MCObjectFormat.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCValue.h" #include "llvm/Support/Debug.h" @@ -388,8 +387,8 @@ static bool EvaluateSymbolicAdd(const MCAssembler *Asm, if (Asm && A && B) { const MCSymbol &SA = A->getSymbol(); const MCSymbol &SB = B->getSymbol(); - const MCObjectFormat &F = Asm->getBackend().getObjectFormat(); - if (SA.isDefined() && SB.isDefined() && F.isAbsolute(InSet, SA, SB)) { + if (SA.isDefined() && SB.isDefined() && + Asm->getWriter().isAbsolute(InSet, SA, SB)) { MCSymbolData &AD = Asm->getSymbolData(A->getSymbol()); MCSymbolData &BD = Asm->getSymbolData(B->getSymbol()); diff --git a/llvm/lib/MC/MCObjectFormat.cpp b/llvm/lib/MC/MCObjectFormat.cpp deleted file mode 100644 index aeff3347187..00000000000 --- a/llvm/lib/MC/MCObjectFormat.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//===- lib/MC/MCObjectFormat.cpp - MCObjectFormat implementation ----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/MC/MCObjectFormat.h" -#include "llvm/MC/MCSymbol.h" - -using namespace llvm; - -MCObjectFormat::~MCObjectFormat() { -} - -bool MCELFObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, - const MCSymbol &B) const { - // On ELF A - B is absolute if A and B are in the same section. - return &A.getSection() == &B.getSection(); -} - -bool MCMachOObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, - const MCSymbol &B) const { - // On MachO A - B is absolute only if in a set. - return IsSet; -} - -bool MCCOFFObjectFormat::isAbsolute(bool IsSet, const MCSymbol &A, - const MCSymbol &B) const { - // On COFF A - B is absolute if A and B are in the same section. - return &A.getSection() == &B.getSection(); -} diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 6ebc782c8e2..42cf43fea34 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/lib/MC/MachObjectWriter.cpp @@ -1123,6 +1123,12 @@ public: UndefinedSymbolData); } + bool isAbsolute(bool IsSet, const MCSymbol &A, + const MCSymbol &B) const { + // On MachO A - B is absolute only if in a set. + return IsSet; + } + bool IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm, const MCSymbolRefExpr *A, const MCSymbolRefExpr *B) const { diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp index 0ad086cbee0..7f756622197 100644 --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -187,6 +187,12 @@ public: return false; } + virtual bool isAbsolute(bool IsSet, const MCSymbol &A, + const MCSymbol &B) const { + // On COFF A - B is absolute if A and B are in the same section. + return &A.getSection() == &B.getSection(); + } + virtual bool IsFixupFullyResolved(const MCAssembler &Asm, const MCValue Target, bool IsPCRel, |