llvm.org GIT mirror llvm / 3284877
add some support for blockaddress. This isn't really enough to be useful, but it will cover uses of blockaddress that are actually in a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106502 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
1 changed file(s) with 5 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
935935 Out << ", " << getCppName(CE->getOperand(i));
936936 Out << ");";
937937 }
938 } else if (const BlockAddress *BA = dyn_cast(CV)) {
939 Out << "Constant* " << constName << " = ";
940 Out << "BlockAddress::get(" << getOpName(BA->getBasicBlock()) << ");";
938941 } else {
939942 error("Bad Constant");
940943 Out << "Constant* " << constName << " = 0; ";
10871090 // forward references. So, we get the names of all the operands in advance
10881091 const unsigned Ops(I->getNumOperands());
10891092 std::string* opNames = new std::string[Ops];
1090 for (unsigned i = 0; i < Ops; i++) {
1093 for (unsigned i = 0; i < Ops; i++)
10911094 opNames[i] = getOpName(I->getOperand(i));
1092 }
10931095
10941096 switch (I->getOpcode()) {
10951097 default:
11051107 case Instruction::Br: {
11061108 const BranchInst* br = cast(I);
11071109 Out << "BranchInst::Create(" ;
1108 if (br->getNumOperands() == 3 ) {
1110 if (br->getNumOperands() == 3) {
11091111 Out << opNames[2] << ", "
11101112 << opNames[1] << ", "
11111113 << opNames[0] << ", ";