mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-26 07:34:14 +00:00
simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25791 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
024c0b34c4
commit
7859313bae
@ -2069,20 +2069,17 @@ public:
|
|||||||
unsigned ResNo = TmpNo++;
|
unsigned ResNo = TmpNo++;
|
||||||
unsigned NumRes = 1;
|
unsigned NumRes = 1;
|
||||||
if (!N->isLeaf() && N->getOperator()->getName() == "imm") {
|
if (!N->isLeaf() && N->getOperator()->getName() == "imm") {
|
||||||
const char* CastType;
|
|
||||||
assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
|
assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
|
||||||
const char *Code;
|
std::string CastType;
|
||||||
switch (N->getTypeNum(0)) {
|
switch (N->getTypeNum(0)) {
|
||||||
default: assert(0 && "Unknown type for constant node!");
|
default: assert(0 && "Unknown type for constant node!");
|
||||||
case MVT::i1: CastType = "bool"; Code = "bool Tmp"; break;
|
case MVT::i1: CastType = "bool"; break;
|
||||||
case MVT::i8:
|
case MVT::i8: CastType = "unsigned char"; break;
|
||||||
CastType = "unsigned char"; Code = "unsigned char Tmp"; break;
|
case MVT::i16: CastType = "unsigned short"; break;
|
||||||
case MVT::i16:
|
case MVT::i32: CastType = "unsigned"; break;
|
||||||
CastType = "unsigned short"; Code = "unsigned short Tmp"; break;
|
case MVT::i64: CastType = "uint64_t"; break;
|
||||||
case MVT::i32: CastType = "unsigned"; Code = "unsigned Tmp"; break;
|
|
||||||
case MVT::i64: CastType = "uint64_t"; Code = "uint64_t Tmp"; break;
|
|
||||||
}
|
}
|
||||||
emitCode(Code + utostr(ResNo) + "C = (" + CastType +
|
emitCode(CastType + " Tmp" + utostr(ResNo) + "C = (" + CastType +
|
||||||
")cast<ConstantSDNode>(" + Val + ")->getValue();");
|
")cast<ConstantSDNode>(" + Val + ")->getValue();");
|
||||||
emitCode("SDOperand Tmp" + utostr(ResNo) +
|
emitCode("SDOperand Tmp" + utostr(ResNo) +
|
||||||
" = CurDAG->getTargetConstant(Tmp" + utostr(ResNo) +
|
" = CurDAG->getTargetConstant(Tmp" + utostr(ResNo) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user