mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 04:33:05 +00:00
207e06ea04
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99380 91177308-0d34-0410-b5e6-96231b3b80d8
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
//===- MCAsmLayout.h - Assembly Layout Object -------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_MC_MCASMLAYOUT_H
|
|
#define LLVM_MC_MCASMLAYOUT_H
|
|
|
|
namespace llvm {
|
|
class MCAssembler;
|
|
class MCFragment;
|
|
class MCSectionData;
|
|
class MCSymbolData;
|
|
|
|
/// Encapsulates the layout of an assembly file at a particular point in time.
|
|
///
|
|
/// Assembly may requiring compute multiple layouts for a particular assembly
|
|
/// file as part of the relaxation process. This class encapsulates the layout
|
|
/// at a single point in time in such a way that it is always possible to
|
|
/// efficiently compute the exact addresses of any symbol in the assembly file,
|
|
/// even during the relaxation process.
|
|
class MCAsmLayout {
|
|
private:
|
|
MCAssembler &Assembler;
|
|
|
|
public:
|
|
MCAsmLayout(MCAssembler &_Assembler) : Assembler(_Assembler) {}
|
|
|
|
/// Get the assembler object this is a layout for.
|
|
MCAssembler &getAssembler() const { return Assembler; }
|
|
|
|
uint64_t getFragmentAddress(const MCFragment *F) const;
|
|
|
|
uint64_t getSectionAddress(const MCSectionData *SD) const;
|
|
|
|
uint64_t getSymbolAddress(const MCSymbolData *SD) const;
|
|
|
|
void setSectionAddress(MCSectionData *SD, uint64_t Value);
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
#endif
|