summaryrefslogtreecommitdiff
path: root/include/llvm/MC
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC')
-rw-r--r--include/llvm/MC/MCAsmBackend.h6
-rw-r--r--include/llvm/MC/MCAssembler.h6
-rw-r--r--include/llvm/MC/MCMachObjectWriter.h28
-rw-r--r--include/llvm/MC/MCObjectWriter.h6
4 files changed, 19 insertions, 27 deletions
diff --git a/include/llvm/MC/MCAsmBackend.h b/include/llvm/MC/MCAsmBackend.h
index 216271086a40..a6d41392724e 100644
--- a/include/llvm/MC/MCAsmBackend.h
+++ b/include/llvm/MC/MCAsmBackend.h
@@ -61,6 +61,12 @@ public:
/// markers. If not, data region directives will be ignored.
bool hasDataInCodeSupport() const { return HasDataInCodeSupport; }
+ /// doesSectionRequireSymbols - Check whether the given section requires that
+ /// all symbols (even temporaries) have symbol table entries.
+ virtual bool doesSectionRequireSymbols(const MCSection &Section) const {
+ return false;
+ }
+
/// @name Target Fixup Interfaces
/// @{
diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
index 31f29eb1f3ff..681a31728799 100644
--- a/include/llvm/MC/MCAssembler.h
+++ b/include/llvm/MC/MCAssembler.h
@@ -11,7 +11,6 @@
#define LLVM_MC_MCASSEMBLER_H
#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/PointerIntPair.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallString.h"
@@ -882,8 +881,6 @@ private:
iplist<MCSymbolData> Symbols;
- DenseSet<const MCSymbol *> LocalsUsedInReloc;
-
/// The map of sections to their associated assembler backend data.
//
// FIXME: Avoid this indirection?
@@ -983,9 +980,6 @@ private:
MCFragment &F, const MCFixup &Fixup);
public:
- void addLocalUsedInReloc(const MCSymbol &Sym);
- bool isLocalUsedInReloc(const MCSymbol &Sym) const;
-
/// Compute the effective fragment size assuming it is laid out at the given
/// \p SectionAddress and \p FragmentOffset.
uint64_t computeFragmentSize(const MCAsmLayout &Layout,
diff --git a/include/llvm/MC/MCMachObjectWriter.h b/include/llvm/MC/MCMachObjectWriter.h
index e4681c0a3dc3..0c5aa8a18063 100644
--- a/include/llvm/MC/MCMachObjectWriter.h
+++ b/include/llvm/MC/MCMachObjectWriter.h
@@ -68,10 +68,12 @@ public:
/// @name API
/// @{
- virtual void RecordRelocation(MachObjectWriter *Writer, MCAssembler &Asm,
+ virtual void RecordRelocation(MachObjectWriter *Writer,
+ const MCAssembler &Asm,
const MCAsmLayout &Layout,
const MCFragment *Fragment,
- const MCFixup &Fixup, MCValue Target,
+ const MCFixup &Fixup,
+ MCValue Target,
uint64_t &FixedValue) = 0;
/// @}
@@ -95,14 +97,8 @@ class MachObjectWriter : public MCObjectWriter {
/// @name Relocation Data
/// @{
- struct RelAndSymbol {
- const MCSymbolData *Sym;
- MachO::any_relocation_info MRE;
- RelAndSymbol(const MCSymbolData *Sym, const MachO::any_relocation_info &MRE)
- : Sym(Sym), MRE(MRE) {}
- };
-
- llvm::DenseMap<const MCSectionData *, std::vector<RelAndSymbol>> Relocations;
+ llvm::DenseMap<const MCSectionData*,
+ std::vector<MachO::any_relocation_info> > Relocations;
llvm::DenseMap<const MCSectionData*, unsigned> IndirectSymBase;
/// @}
@@ -217,15 +213,9 @@ public:
// - Input errors, where something cannot be correctly encoded. 'as' allows
// these through in many cases.
- // Add a relocation to be output in the object file. At the time this is
- // called, the symbol indexes are not know, so if the relocation refers
- // to a symbol it should be passed as \p RelSymbol so that it can be updated
- // afterwards. If the relocation doesn't refer to a symbol, nullptr should be
- // used.
- void addRelocation(const MCSymbolData *RelSymbol, const MCSectionData *SD,
+ void addRelocation(const MCSectionData *SD,
MachO::any_relocation_info &MRE) {
- RelAndSymbol P(RelSymbol, MRE);
- Relocations[SD].push_back(P);
+ Relocations[SD].push_back(MRE);
}
void RecordScatteredRelocation(const MCAssembler &Asm,
@@ -241,7 +231,7 @@ public:
const MCFixup &Fixup, MCValue Target,
uint64_t &FixedValue);
- void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout,
+ void RecordRelocation(const MCAssembler &Asm, const MCAsmLayout &Layout,
const MCFragment *Fragment, const MCFixup &Fixup,
MCValue Target, bool &IsPCRel,
uint64_t &FixedValue) override;
diff --git a/include/llvm/MC/MCObjectWriter.h b/include/llvm/MC/MCObjectWriter.h
index 173ef416f2cc..55c828c6c179 100644
--- a/include/llvm/MC/MCObjectWriter.h
+++ b/include/llvm/MC/MCObjectWriter.h
@@ -76,10 +76,12 @@ public:
/// post layout binding. The implementation is responsible for storing
/// information about the relocation so that it can be emitted during
/// WriteObject().
- virtual void RecordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout,
+ virtual void RecordRelocation(const MCAssembler &Asm,
+ const MCAsmLayout &Layout,
const MCFragment *Fragment,
const MCFixup &Fixup, MCValue Target,
- bool &IsPCRel, uint64_t &FixedValue) = 0;
+ bool &IsPCRel,
+ uint64_t &FixedValue) = 0;
/// \brief Check whether the difference (A - B) between two symbol
/// references is fully resolved.