mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Fold iType into Value::VTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14435 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7da38ec915
commit
40515dba1b
@ -25,9 +25,7 @@ void Instruction::init()
|
|||||||
|
|
||||||
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
||||||
Instruction *InsertBefore)
|
Instruction *InsertBefore)
|
||||||
: User(ty, Value::InstructionVal, Name),
|
: User(ty, Value::InstructionVal + it, Name), Parent(0) {
|
||||||
Parent(0),
|
|
||||||
iType(it) {
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
// If requested, insert this instruction into a basic block...
|
// If requested, insert this instruction into a basic block...
|
||||||
@ -40,9 +38,7 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
|||||||
|
|
||||||
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
||||||
BasicBlock *InsertAtEnd)
|
BasicBlock *InsertAtEnd)
|
||||||
: User(ty, Value::InstructionVal, Name),
|
: User(ty, Value::InstructionVal + it, Name), Parent(0) {
|
||||||
Parent(0),
|
|
||||||
iType(it) {
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
// append this instruction into the basic block
|
// append this instruction into the basic block
|
||||||
@ -50,6 +46,10 @@ Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
|
|||||||
InsertAtEnd->getInstList().push_back(this);
|
InsertAtEnd->getInstList().push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Instruction::setOpcode(unsigned opc) {
|
||||||
|
setValueType(Value::InstructionVal + opc);
|
||||||
|
}
|
||||||
|
|
||||||
void Instruction::setParent(BasicBlock *P) {
|
void Instruction::setParent(BasicBlock *P) {
|
||||||
if (getParent()) {
|
if (getParent()) {
|
||||||
if (!P) LeakDetector::addGarbageObject(this);
|
if (!P) LeakDetector::addGarbageObject(this);
|
||||||
|
@ -173,7 +173,8 @@ bool BinaryOperator::swapOperands() {
|
|||||||
if (isCommutative())
|
if (isCommutative())
|
||||||
; // If the instruction is commutative, it is safe to swap the operands
|
; // If the instruction is commutative, it is safe to swap the operands
|
||||||
else if (SetCondInst *SCI = dyn_cast<SetCondInst>(this))
|
else if (SetCondInst *SCI = dyn_cast<SetCondInst>(this))
|
||||||
iType = SCI->getSwappedCondition();
|
/// FIXME: SetCC instructions shouldn't all have different opcodes.
|
||||||
|
setOpcode(SCI->getSwappedCondition());
|
||||||
else
|
else
|
||||||
return true; // Can't commute operands
|
return true; // Can't commute operands
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user