summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2015-05-06 17:05:54 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2015-05-06 17:05:54 +0000
commit633dba4f412fd7cfe0e1b5d7bdc60338e81beaf3 (patch)
treec8869349172fe19f460ff10a1d136ddb01269b51 /llvm/lib/CodeGen/MachineInstr.cpp
parent5d8dfd39e1135dfdea044ff40f1c6dbef3489e73 (diff)
downloadbcm5719-llvm-633dba4f412fd7cfe0e1b5d7bdc60338e81beaf3.tar.gz
bcm5719-llvm-633dba4f412fd7cfe0e1b5d7bdc60338e81beaf3.zip
Add ChangeTo* to MachineOperand for symbols
llvm-svn: 236612
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineInstr.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp
index 7f3c3e935a2..4d290f58a81 100644
--- a/llvm/lib/CodeGen/MachineInstr.cpp
+++ b/llvm/lib/CodeGen/MachineInstr.cpp
@@ -141,6 +141,28 @@ void MachineOperand::ChangeToFPImmediate(const ConstantFP *FPImm) {
Contents.CFP = FPImm;
}
+void MachineOperand::ChangeToES(const char *SymName, unsigned char TargetFlags) {
+ assert((!isReg() || !isTied()) &&
+ "Cannot change a tied operand into an external symbol");
+
+ removeRegFromUses();
+
+ OpKind = MO_ExternalSymbol;
+ Contents.OffsetedInfo.Val.SymbolName = SymName;
+ setOffset(0); // Offset is always 0.
+ setTargetFlags(TargetFlags);
+}
+
+void MachineOperand::ChangeToMCSymbol(MCSymbol *Sym) {
+ assert((!isReg() || !isTied()) &&
+ "Cannot change a tied operand into an MCSymbol");
+
+ removeRegFromUses();
+
+ OpKind = MO_MCSymbol;
+ Contents.Sym = Sym;
+}
+
/// ChangeToRegister - Replace this operand with a new register operand of
/// the specified value. If an operand is known to be an register already,
/// the setReg method should be used.
OpenPOWER on IntegriCloud