#define LLVM_CODEGEN_SELECTIONDAG_H
#include "llvm/ADT/FoldingSet.h"
+#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/ilist.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
class MachineModuleInfo;
class MachineFunction;
class MachineConstantPoolValue;
+ class FunctionLoweringInfo;
/// SelectionDAG class - This is used to represent a portion of an LLVM function
/// in a low-level Data Dependence DAG representation suitable for instruction
class SelectionDAG {
TargetLowering &TLI;
MachineFunction &MF;
+ FunctionLoweringInfo &FLI;
MachineModuleInfo *MMI;
/// Root - The root of the entire DAG. EntryNode - The starting token.
FoldingSet<SDNode> CSEMap;
public:
- SelectionDAG(TargetLowering &tli, MachineFunction &mf, MachineModuleInfo *mmi)
- : TLI(tli), MF(mf), MMI(mmi) {
+ SelectionDAG(TargetLowering &tli, MachineFunction &mf,
+ FunctionLoweringInfo &fli, MachineModuleInfo *mmi)
+ : TLI(tli), MF(mf), FLI(fli), MMI(mmi) {
EntryNode = Root = getNode(ISD::EntryToken, MVT::Other);
}
~SelectionDAG();
MachineFunction &getMachineFunction() const { return MF; }
const TargetMachine &getTarget() const;
TargetLowering &getTargetLoweringInfo() const { return TLI; }
+ FunctionLoweringInfo &getFunctionLoweringInfo() const { return FLI; }
MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
/// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
typedef ilist<SDNode>::iterator allnodes_iterator;
allnodes_iterator allnodes_begin() { return AllNodes.begin(); }
allnodes_iterator allnodes_end() { return AllNodes.end(); }
+ ilist<SDNode>::size_type allnodes_size() const { return AllNodes.size(); }
/// getRoot - Return the root tag of the SelectionDAG.
///
std::vector<SDNode*> ValueTypeNodes;
std::map<MVT, SDNode*, MVT::compareRawBits> ExtendedValueTypeNodes;
- std::map<std::string, SDNode*> ExternalSymbols;
- std::map<std::string, SDNode*> TargetExternalSymbols;
- std::map<std::string, StringSDNode*> StringNodes;
+ StringMap<SDNode*> ExternalSymbols;
+ StringMap<SDNode*> TargetExternalSymbols;
+ StringMap<StringSDNode*> StringNodes;
};
template <> struct GraphTraits<SelectionDAG*> : public GraphTraits<SDNode*> {