X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FCodeGen%2FMachineBlockPlacement.cpp;h=661a4e321aff7cbc0535288e96356ee1fed870ae;hb=0d1521330705827822808f6f321b9cd371594569;hp=891f605e2a1535eb91db9ceca12d7072b38b20a7;hpb=255907042245b77779e3e38c5ce66901866cabe5;p=oota-llvm.git diff --git a/lib/CodeGen/MachineBlockPlacement.cpp b/lib/CodeGen/MachineBlockPlacement.cpp index 891f605e2a1..661a4e321af 100644 --- a/lib/CodeGen/MachineBlockPlacement.cpp +++ b/lib/CodeGen/MachineBlockPlacement.cpp @@ -42,6 +42,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Target/TargetInstrInfo.h" #include "llvm/Target/TargetLowering.h" +#include "llvm/Target/TargetSubtargetInfo.h" #include using namespace llvm; @@ -264,19 +265,23 @@ INITIALIZE_PASS_END(MachineBlockPlacement, "block-placement2", /// /// Only used by debug logging. static std::string getBlockName(MachineBasicBlock *BB) { - string_ostream OS; + std::string Result; + raw_string_ostream OS(Result); OS << "BB#" << BB->getNumber() << " (derived from LLVM BB '" << BB->getName() << "')"; - return OS.str(); + OS.flush(); + return Result; } /// \brief Helper to print the number of a MBB. /// /// Only used by debug logging. static std::string getBlockNum(MachineBasicBlock *BB) { - string_ostream OS; + std::string Result; + raw_string_ostream OS(Result); OS << "BB#" << BB->getNumber(); - return OS.str(); + OS.flush(); + return Result; } #endif @@ -1107,8 +1112,8 @@ bool MachineBlockPlacement::runOnMachineFunction(MachineFunction &F) { MBPI = &getAnalysis(); MBFI = &getAnalysis(); MLI = &getAnalysis(); - TII = F.getTarget().getInstrInfo(); - TLI = F.getTarget().getTargetLowering(); + TII = F.getSubtarget().getInstrInfo(); + TLI = F.getSubtarget().getTargetLowering(); assert(BlockToChain.empty()); buildCFGChains(F);