Path: blob/main/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCInstrBuilder.h
35266 views
//===-- PPCInstrBuilder.h - Aides for building PPC insts --------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file exposes functions that may be used with BuildMI from the9// MachineInstrBuilder.h file to simplify generating frame and constant pool10// references.11//12// For reference, the order of operands for memory references is:13// (Operand), Dest Reg, Base Reg, and either Reg Index or Immediate14// Displacement.15//16//===----------------------------------------------------------------------===//1718#ifndef LLVM_LIB_TARGET_POWERPC_PPCINSTRBUILDER_H19#define LLVM_LIB_TARGET_POWERPC_PPCINSTRBUILDER_H2021#include "llvm/CodeGen/MachineInstrBuilder.h"2223namespace llvm {2425/// addFrameReference - This function is used to add a reference to the base of26/// an abstract object on the stack frame of the current function. This27/// reference has base register as the FrameIndex offset until it is resolved.28/// This allows a constant offset to be specified as well...29///30static inline const MachineInstrBuilder&31addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,32bool mem = true) {33if (mem)34return MIB.addImm(Offset).addFrameIndex(FI);35else36return MIB.addFrameIndex(FI).addImm(Offset);37}3839} // End llvm namespace4041#endif424344