blob: a5d4dca530fb85f9555dcde425fefed6e7e78e8d [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- IA64PCInstrBuilder.h - Aids for building IA64 insts -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file exposes functions that may be used with BuildMI from the
11// MachineInstrBuilder.h file to simplify generating frame and constant pool
12// references.
13//
14//===----------------------------------------------------------------------===//
15
16#ifndef IA64_INSTRBUILDER_H
17#define IA64_INSTRBUILDER_H
18
19#include "llvm/CodeGen/MachineInstrBuilder.h"
20
21namespace llvm {
22
23/// addFrameReference - This function is used to add a reference to the base of
24/// an abstract object on the stack frame of the current function. This
25/// reference has base register as the FrameIndex offset until it is resolved.
26/// This allows a constant offset to be specified as well...
27///
28inline const MachineInstrBuilder&
29addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,
30 bool mem = true) {
31 if (mem)
32 return MIB.addImm(Offset).addFrameIndex(FI);
33 else
34 return MIB.addFrameIndex(FI).addImm(Offset);
35}
36
Dan Gohmanf17a25c2007-07-18 16:29:46 +000037} // End llvm namespace
38
39#endif
40