#ifndef LLVM_CODEGEN_INSTRFOREST_H
#define LLVM_CODEGEN_INSTRFOREST_H
-#include "llvm/Support/NonCopyable.h"
-#include "llvm/Instruction.h"
+//************************** System Include Files **************************/
+
#include <hash_map>
#include <hash_set>
+//*************************** User Include Files ***************************/
+
+#include "llvm/Support/NonCopyable.h"
+#include "llvm/Support/HashExtras.h"
+#include "llvm/Instruction.h"
+
+//************************* Opaque Declarations ****************************/
+
class ConstPoolVal;
class BasicBlock;
class Method;
class InstrTreeNode;
class InstrForest;
+/******************** Exported Data Types and Constants ********************/
+
//--------------------------------------------------------------------------
// OpLabel values for special-case nodes created for instruction selection.
// All op-labels not defined here are identical to the instruction
extern int treecost (BasicTreeNode*, int, int);
extern void printMatches (BasicTreeNode*);
-//************************ Exported Data Types *****************************/
-// Provide a hash function for arbitrary pointers...
-template <class T> struct hash<T *> {
- inline size_t operator()(T *Val) const { return (size_t)Val; }
-};
+//*********************** Public Class Declarations ************************/
//------------------------------------------------------------------------
// class InstrTreeNode
class InstructionNode: public InstrTreeNode {
public:
/*ctor*/ InstructionNode (Instruction* _instr);
- Instruction* getInstruction () const { return (Instruction*) val; }
- void reverseBinaryArgumentOrder();
+ Instruction* getInstruction () const {
+ assert(treeNodeType == NTInstructionNode);
+ return (Instruction*) val;
+ }
protected:
virtual void dumpNode (int indent) const;
};
InstructionNode* buildTreeForInstruction(Instruction* instr);
};
-//---------------------------------------------------------------------------
-#endif /* #ifndef INSTRFOREST_H */
+/***************************************************************************/
+
+#endif