aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-29 20:07:50 +0000
committerChris Lattner <sabre@nondot.org>2002-10-29 20:07:50 +0000
commit35c9a6ded70627b68b282c3ca993c43d93fcb71a (patch)
treea9e71a138d39c0a062d15ea2b83fa18fa408a754
parent495fe2e087c5f4ec4372d8f6d2fdc27ff93c61c5 (diff)
X86 merge complete, eliminate dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4401 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MInstBuilder.h71
1 files changed, 0 insertions, 71 deletions
diff --git a/include/llvm/CodeGen/MInstBuilder.h b/include/llvm/CodeGen/MInstBuilder.h
deleted file mode 100644
index 6ff5777503..0000000000
--- a/include/llvm/CodeGen/MInstBuilder.h
+++ /dev/null
@@ -1,71 +0,0 @@
-//===-- CodeGen/MInstBuilder.h - Simplify creation of MInstcn's -*- C++ -*-===//
-//
-// This file exposes a function named BuildMInst that is useful for dramatically
-// simplifying how MInstruction's are created. Instead of using code like this:
-//
-// M = new MInstruction(BB, X86::ADDrr32, DestReg);
-// M->addOperand(Arg0Reg, MOperand::Register);
-// M->addOperand(Arg1Reg, MOperand::Register);
-//
-// we can now use code like this:
-//
-// M = BuildMInst(BB, X86::ADDrr8, DestReg).addReg(Arg0Reg).addReg(Arg1Reg);
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_CODEGEN_MINSTBUILDER_H
-#define LLVM_CODEGEN_MINSTBUILDER_H
-
-#include "llvm/CodeGen/MInstruction.h"
-
-struct MInstructionBuilder {
- MInstruction *MI;
-
- MInstructionBuilder(MInstruction *mi) : MI(mi) {}
-
- /// Allow automatic conversion to the machine instruction we are working on.
- ///
- operator MInstruction*() const { return MI; }
-
- /// addReg - Add a new register operand...
- ///
- MInstructionBuilder &addReg(unsigned RegNo) {
- MI->addOperand(RegNo, MOperand::Register);
- return *this;
- }
-
- /// addSImm - Add a new sign extended immediate operand...
- ///
- MInstructionBuilder &addSImm(int Val) {
- MI->addOperand(Val, MOperand::SignExtImmediate);
- return *this;
- }
-
- /// addZImm - Add a new zero extended immediate operand...
- ///
- MInstructionBuilder &addZImm(unsigned Val) {
- MI->addOperand(Val, MOperand::ZeroExtImmediate);
- return *this;
- }
-
- /// addPCDisp - Add a PC Relative Displacement operand...
- ///
- MInstructionBuilder &addPCDisp(int Disp) {
- MI->addOperand(Disp, MOperand::PCRelativeDisp);
- return *this;
- }
-};
-
-/// BuildMInst - Builder interface. Specify how to create the initial
-/// instruction itself.
-///
-inline MInstructionBuilder BuildMInst(unsigned Opcode, unsigned DestReg = 0) {
- return MInstructionBuilder(new MInstruction(Opcode, DestReg));
-}
-
-inline MInstructionBuilder BuildMInst(MBasicBlock *BB, unsigned Opcode,
- unsigned DestReg = 0) {
- return MInstructionBuilder(new MInstruction(BB, Opcode, DestReg));
-}
-
-#endif