Ticket #29156: dragonegg_llvm29_compat.diff

File dragonegg_llvm29_compat.diff, 1.5 KB (added by howarth@…, 13 years ago)

patch for llvm 2.9 compatibility for dragonegg trunk svn

  • src/Convert.cpp

    void TreeToLLVM::PopulatePhiNodes() { 
    902902    }
    903903
    904904    // Add the operands to the phi node.
     905    P.PHI->reserveOperandSpace(PhiArguments.size());
    905906    for (ValueVector::iterator I = PhiArguments.begin(), E = PhiArguments.end();
    906907         I != E; ++I)
    907908      P.PHI->addIncoming(I->second, I->first);
    void TreeToLLVM::EmitBasicBlock(basic_bl 
    10971098
    10981099    // Create the LLVM phi node.
    10991100    const Type *Ty = getRegType(TREE_TYPE(gimple_phi_result(gcc_phi)));
    1100     PHINode *PHI = Builder.CreatePHI(Ty, gimple_phi_num_args(gcc_phi));
     1101    PHINode *PHI = Builder.CreatePHI(Ty);
    11011102
    11021103    // The phi defines the associated ssa name.
    11031104    tree name = gimple_phi_result(gcc_phi);
    void TreeToLLVM::EmitLandingPads() { 
    19551956      if (InVal == 0) {
    19561957        // Different unwind edges have different values.  Create a new PHI node
    19571958        // in LPad.
    1958         PHINode *NewPN = PHINode::Create(PN->getType(), std::distance(PB, PE),
    1959                                          PN->getName()+".lpad", LPad);
     1959        PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName()+".lpad",
     1960                                         LPad);
    19601961        // Add an entry for each unwind edge, using the value from the old PHI.
    19611962        for (pred_iterator PI = PB; PI != PE; ++PI)
    19621963          NewPN->addIncoming(PN->getIncomingValueForBlock(*PI), *PI);