summaryrefslogtreecommitdiff
path: root/include/llvm/AddressingMode.h
blob: 70b3c05238c5bc5e4cd85f86c667f4153c67d9c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//===--------- llvm/AddressingMode.h - Addressing Mode    -------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//  This file contains addressing mode data structures which are shared
//  between LSR and a number of places in the codegen.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ADDRESSING_MODE_H
#define LLVM_ADDRESSING_MODE_H

#include "llvm/Support/DataTypes.h"

namespace llvm {

class GlobalValue;

/// AddrMode - This represents an addressing mode of:
///    BaseGV + BaseOffs + BaseReg + Scale*ScaleReg
/// If BaseGV is null,  there is no BaseGV.
/// If BaseOffs is zero, there is no base offset.
/// If HasBaseReg is false, there is no base register.
/// If Scale is zero, there is no ScaleReg.  Scale of 1 indicates a reg with
/// no scale.
///
struct AddrMode {
  GlobalValue *BaseGV;
  int64_t      BaseOffs;
  bool         HasBaseReg;
  int64_t      Scale;
  AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {}
};

} // End llvm namespace

#endif