1 //===- MCAsmLayout.h - Assembly Layout Object -------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCASMLAYOUT_H
11 #define LLVM_MC_MCASMLAYOUT_H
16 /// Encapsulates the layout of an assembly file at a particular point in time.
18 /// Assembly may requiring compute multiple layouts for a particular assembly
19 /// file as part of the relaxation process. This class encapsulates the layout
20 /// at a single point in time in such a way that it is always possible to
21 /// efficiently compute the exact addresses of any symbol in the assembly file,
22 /// even during the relaxation process.
25 uint64_t CurrentLocation;
27 MCAssembler &Assembler;
30 MCAsmLayout(MCAssembler &_Assembler)
31 : CurrentLocation(0), Assembler(_Assember) {}
33 /// Get the assembler object this is a layout for.
34 MCAssembler &getAssembler() { return Assembler; }
36 /// Get the current location value, i.e. that value of the '.' expression.
37 uin64_t getCurrentLocation() {
38 return CurrentLocation;
41 /// Set the current location.
42 void setCurrentLocation(uint64_t Value) {
43 CurrentLocation = Value;
47 } // end namespace llvm