1 //===-- llvm/CodeGen/MachineLocation.h --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by James M. Laskey and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 // The MachineLocation class is used to represent a simple location in a machine
10 // frame. Locations will be one of two forms; a register or an address formed
11 // from a base address plus an offset.
12 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CODEGEN_MACHINELOCATION_H
16 #define LLVM_CODEGEN_MACHINELOCATION_H
20 class MachineLocation {
22 bool IsRegister; // True if location is a register.
23 unsigned Register; // gcc/gdb register number.
24 int Offset; // Displacement if not register.
32 MachineLocation(unsigned R)
37 MachineLocation(unsigned R, int O)
44 bool isRegister() const { return IsRegister; }
45 unsigned getRegister() const { return Register; }
46 int getOffset() const { return Offset; }
47 void setIsRegister(bool Is) { IsRegister = Is; }
48 void setRegister(unsigned R) { Register = R; }
49 void setOffset(int O) { Offset = O; }
50 void set(unsigned R) {
55 void set(unsigned R, int O) {
62 } // End llvm namespace