#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/ADT/SmallSet.h"
namespace llvm {
/// HazardRecognizer - This determines whether or not an instruction can be
///
class ScheduleDAGSDNodes : public ScheduleDAG {
public:
- SmallSet<SDNode*, 16> CommuteSet; // Nodes that should be commuted.
-
ScheduleDAGSDNodes(SelectionDAG *dag, MachineBasicBlock *bb,
const TargetMachine &tm);
///
SUnit *NewSUnit(SDNode *N) {
#ifndef NDEBUG
- const SUnit *Addr = &SUnits[0];
+ const SUnit *Addr = 0;
+ if (SUnits.size() > 0)
+ Addr = &SUnits[0];
#endif
SUnits.push_back(SUnit(N, (unsigned)SUnits.size()));
- assert(Addr == &SUnits[0] && "SUnits std::vector reallocated on the fly!");
+ assert((Addr == 0 || Addr == &SUnits[0]) &&
+ "SUnits std::vector reallocated on the fly!");
SUnits.back().OrigNode = &SUnits.back();
return &SUnits.back();
}