llvm.org GIT mirror llvm / 7859313
simplify some code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25791 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
1 changed file(s) with 7 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
20682068 unsigned ResNo = TmpNo++;
20692069 unsigned NumRes = 1;
20702070 if (!N->isLeaf() && N->getOperator()->getName() == "imm") {
2071 const char* CastType;
20722071 assert(N->getExtTypes().size() == 1 && "Multiple types not handled!");
2073 const char *Code;
2072 std::string CastType;
20742073 switch (N->getTypeNum(0)) {
20752074 default: assert(0 && "Unknown type for constant node!");
2076 case MVT::i1: CastType = "bool"; Code = "bool Tmp"; break;
2077 case MVT::i8:
2078 CastType = "unsigned char"; Code = "unsigned char Tmp"; break;
2079 case MVT::i16:
2080 CastType = "unsigned short"; Code = "unsigned short Tmp"; break;
2081 case MVT::i32: CastType = "unsigned"; Code = "unsigned Tmp"; break;
2082 case MVT::i64: CastType = "uint64_t"; Code = "uint64_t Tmp"; break;
2075 case MVT::i1: CastType = "bool"; break;
2076 case MVT::i8: CastType = "unsigned char"; break;
2077 case MVT::i16: CastType = "unsigned short"; break;
2078 case MVT::i32: CastType = "unsigned"; break;
2079 case MVT::i64: CastType = "uint64_t"; break;
20832080 }
2084 emitCode(Code + utostr(ResNo) + "C = (" + CastType +
2081 emitCode(CastType + " Tmp" + utostr(ResNo) + "C = (" + CastType +
20852082 ")cast(" + Val + ")->getValue();");
20862083 emitCode("SDOperand Tmp" + utostr(ResNo) +
20872084 " = CurDAG->getTargetConstant(Tmp" + utostr(ResNo) +