]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/include/llvm/AddressingMode.h
MFC r244628:
[FreeBSD/stable/9.git] / contrib / llvm / include / llvm / AddressingMode.h
1 //===--------- llvm/AddressingMode.h - Addressing Mode    -------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //  This file contains addressing mode data structures which are shared
10 //  between LSR and a number of places in the codegen.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_ADDRESSING_MODE_H
15 #define LLVM_ADDRESSING_MODE_H
16
17 #include "llvm/Support/DataTypes.h"
18
19 namespace llvm {
20
21 class GlobalValue;
22
23 /// AddrMode - This represents an addressing mode of:
24 ///    BaseGV + BaseOffs + BaseReg + Scale*ScaleReg
25 /// If BaseGV is null,  there is no BaseGV.
26 /// If BaseOffs is zero, there is no base offset.
27 /// If HasBaseReg is false, there is no base register.
28 /// If Scale is zero, there is no ScaleReg.  Scale of 1 indicates a reg with
29 /// no scale.
30 ///
31 struct AddrMode {
32   GlobalValue *BaseGV;
33   int64_t      BaseOffs;
34   bool         HasBaseReg;
35   int64_t      Scale;
36   AddrMode() : BaseGV(0), BaseOffs(0), HasBaseReg(false), Scale(0) {}
37 };
38
39 } // End llvm namespace
40
41 #endif