mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Add ChangeTo* to MachineOperand for symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
683cf0f88f
commit
530a574a9d
@ -554,6 +554,12 @@ public:
|
|||||||
/// already, the setFPImm method should be used.
|
/// already, the setFPImm method should be used.
|
||||||
void ChangeToFPImmediate(const ConstantFP *FPImm);
|
void ChangeToFPImmediate(const ConstantFP *FPImm);
|
||||||
|
|
||||||
|
/// ChangeToES - Replace this operand with a new external symbol operand.
|
||||||
|
void ChangeToES(const char *SymName, unsigned char TargetFlags = 0);
|
||||||
|
|
||||||
|
/// ChangeToMCSymbol - Replace this operand with a new MC symbol operand.
|
||||||
|
void ChangeToMCSymbol(MCSymbol *Sym);
|
||||||
|
|
||||||
/// ChangeToRegister - Replace this operand with a new register operand of
|
/// ChangeToRegister - Replace this operand with a new register operand of
|
||||||
/// the specified value. If an operand is known to be an register already,
|
/// the specified value. If an operand is known to be an register already,
|
||||||
/// the setReg method should be used.
|
/// the setReg method should be used.
|
||||||
|
@ -141,6 +141,28 @@ void MachineOperand::ChangeToFPImmediate(const ConstantFP *FPImm) {
|
|||||||
Contents.CFP = 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
|
/// ChangeToRegister - Replace this operand with a new register operand of
|
||||||
/// the specified value. If an operand is known to be an register already,
|
/// the specified value. If an operand is known to be an register already,
|
||||||
/// the setReg method should be used.
|
/// the setReg method should be used.
|
||||||
|
Loading…
Reference in New Issue
Block a user