[llvm-commits] [llvm] r74155 - in /llvm/trunk/include/llvm/CodeGen: MachineInstrBuilder.h MachineOperand.h
Chris Lattner
sabre at nondot.org
Wed Jun 24 18:16:23 PDT 2009
Author: lattner
Date: Wed Jun 24 20:16:22 2009
New Revision: 74155
URL: http://llvm.org/viewvc/llvm-project?rev=74155&view=rev
Log:
ad MachineInstrBuilder support for target flags on operands.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
llvm/trunk/include/llvm/CodeGen/MachineOperand.h
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h?rev=74155&r1=74154&r2=74155&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstrBuilder.h Wed Jun 24 20:16:22 2009
@@ -74,8 +74,9 @@
return *this;
}
- const MachineInstrBuilder &addMBB(MachineBasicBlock *MBB) const {
- MI->addOperand(MachineOperand::CreateMBB(MBB));
+ const MachineInstrBuilder &addMBB(MachineBasicBlock *MBB,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(MachineOperand::CreateMBB(MBB, TargetFlags));
return *this;
}
@@ -85,25 +86,29 @@
}
const MachineInstrBuilder &addConstantPoolIndex(unsigned Idx,
- int Offset = 0) const {
- MI->addOperand(MachineOperand::CreateCPI(Idx, Offset));
+ int Offset = 0,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(MachineOperand::CreateCPI(Idx, Offset, TargetFlags));
return *this;
}
- const MachineInstrBuilder &addJumpTableIndex(unsigned Idx) const {
- MI->addOperand(MachineOperand::CreateJTI(Idx));
+ const MachineInstrBuilder &addJumpTableIndex(unsigned Idx,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(MachineOperand::CreateJTI(Idx, TargetFlags));
return *this;
}
const MachineInstrBuilder &addGlobalAddress(GlobalValue *GV,
- int64_t Offset = 0) const {
- MI->addOperand(MachineOperand::CreateGA(GV, Offset));
+ int64_t Offset = 0,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(MachineOperand::CreateGA(GV, Offset, TargetFlags));
return *this;
}
const MachineInstrBuilder &addExternalSymbol(const char *FnName,
- int64_t Offset = 0) const {
- MI->addOperand(MachineOperand::CreateES(FnName, Offset));
+ int64_t Offset = 0,
+ unsigned char TargetFlags = 0) const {
+ MI->addOperand(MachineOperand::CreateES(FnName, Offset, TargetFlags));
return *this;
}
@@ -126,13 +131,17 @@
if (MO.isFI())
return addFrameIndex(MO.getIndex());
if (MO.isGlobal())
- return addGlobalAddress(MO.getGlobal(), MO.getOffset());
+ return addGlobalAddress(MO.getGlobal(), MO.getOffset(),
+ MO.getTargetFlags());
if (MO.isCPI())
- return addConstantPoolIndex(MO.getIndex(), MO.getOffset());
+ return addConstantPoolIndex(MO.getIndex(), MO.getOffset(),
+ MO.getTargetFlags());
if (MO.isSymbol())
- return addExternalSymbol(MO.getSymbolName());
+ return addExternalSymbol(MO.getSymbolName(), MO.getOffset(),
+ MO.getTargetFlags());
if (MO.isJTI())
- return addJumpTableIndex(MO.getIndex());
+ return addJumpTableIndex(MO.getIndex(),
+ MO.getTargetFlags());
assert(0 && "Unknown operand for MachineInstrBuilder::AddOperand!");
return *this;
Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=74155&r1=74154&r2=74155&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Wed Jun 24 20:16:22 2009
@@ -371,9 +371,11 @@
Op.SubReg = SubReg;
return Op;
}
- static MachineOperand CreateMBB(MachineBasicBlock *MBB) {
+ static MachineOperand CreateMBB(MachineBasicBlock *MBB,
+ unsigned char TargetFlags = 0) {
MachineOperand Op(MachineOperand::MO_MachineBasicBlock);
Op.setMBB(MBB);
+ Op.setTargetFlags(TargetFlags);
return Op;
}
static MachineOperand CreateFI(unsigned Idx) {
@@ -381,27 +383,35 @@
Op.setIndex(Idx);
return Op;
}
- static MachineOperand CreateCPI(unsigned Idx, int Offset) {
+ static MachineOperand CreateCPI(unsigned Idx, int Offset,
+ unsigned char TargetFlags = 0) {
MachineOperand Op(MachineOperand::MO_ConstantPoolIndex);
Op.setIndex(Idx);
Op.setOffset(Offset);
+ Op.setTargetFlags(TargetFlags);
return Op;
}
- static MachineOperand CreateJTI(unsigned Idx) {
+ static MachineOperand CreateJTI(unsigned Idx,
+ unsigned char TargetFlags = 0) {
MachineOperand Op(MachineOperand::MO_JumpTableIndex);
Op.setIndex(Idx);
+ Op.setTargetFlags(TargetFlags);
return Op;
}
- static MachineOperand CreateGA(GlobalValue *GV, int64_t Offset) {
+ static MachineOperand CreateGA(GlobalValue *GV, int64_t Offset,
+ unsigned char TargetFlags = 0) {
MachineOperand Op(MachineOperand::MO_GlobalAddress);
Op.Contents.OffsetedInfo.Val.GV = GV;
Op.setOffset(Offset);
+ Op.setTargetFlags(TargetFlags);
return Op;
}
- static MachineOperand CreateES(const char *SymName, int64_t Offset = 0) {
+ static MachineOperand CreateES(const char *SymName, int64_t Offset = 0,
+ unsigned char TargetFlags = 0) {
MachineOperand Op(MachineOperand::MO_ExternalSymbol);
Op.Contents.OffsetedInfo.Val.SymbolName = SymName;
Op.setOffset(Offset);
+ Op.setTargetFlags(TargetFlags);
return Op;
}
const MachineOperand &operator=(const MachineOperand &MO) {
More information about the llvm-commits
mailing list