More cpp backend fixes. Now for FP stuff.
authorAnton Korobeynikov <asl@math.spbu.ru>
Fri, 21 Aug 2009 12:50:54 +0000 (12:50 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Fri, 21 Aug 2009 12:50:54 +0000 (12:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79626 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CppBackend/CPPBackend.cpp

index 3d7eefa2d072dbc31e3556575a728f7b7138623d..3e393030e816cee41a718ee9b04da23deb9547c8 100644 (file)
@@ -223,7 +223,7 @@ namespace {
     APFloat APF = APFloat(CFP->getValueAPF());  // copy
     if (CFP->getType() == Type::getFloatTy(CFP->getContext()))
       APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &ignored);
-    Out << "ConstantFP::get(";
+    Out << "ConstantFP::get(getGlobalContext(), ";
     Out << "APFloat(";
 #if HAVE_PRINTF_A
     char Buffer[100];
@@ -1214,7 +1214,7 @@ namespace {
       break;
     }
     case Instruction::FCmp: {
-      Out << "FCmpInst* " << iName << " = new FCmpInst(";
+      Out << "FCmpInst* " << iName << " = new FCmpInst(*" << bbname << ", ";
       switch (cast<FCmpInst>(I)->getPredicate()) {
       case FCmpInst::FCMP_FALSE: Out << "FCmpInst::FCMP_FALSE"; break;
       case FCmpInst::FCMP_OEQ  : Out << "FCmpInst::FCMP_OEQ"; break;
@@ -1236,7 +1236,7 @@ namespace {
       }
       Out << ", " << opNames[0] << ", " << opNames[1] << ", \"";
       printEscapedString(I->getName());
-      Out << "\", " << bbname << ");";
+      Out << "\");";
       break;
     }
     case Instruction::ICmp: {