aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/RegColorMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen/RegColorMap.h')
-rw-r--r--include/llvm/CodeGen/RegColorMap.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/RegColorMap.h b/include/llvm/CodeGen/RegColorMap.h
new file mode 100644
index 0000000000..10987a5927
--- /dev/null
+++ b/include/llvm/CodeGen/RegColorMap.h
@@ -0,0 +1,37 @@
+#ifndef REG_COLOR_MAP
+#define REG_COLOR_MAP
+
+#include <hash_map>
+
+
+#ifndef VALUE_SET_H
+
+struct hashFuncValue { // sturcture containing the hash func
+ inline size_t operator () (const Value *const val) const
+ { return (size_t) val; }
+};
+
+#endif
+
+
+typedef int RegColorType;
+
+
+class RegColorMap : hash_map <const Value *, RegColorType, hashFuncValue>
+{
+
+ public:
+
+ inline void setRegColor(const Value *const Val, RegColorType Col) {
+ (*this)[Val] = Col;
+ }
+
+
+ inline RegColorType getRegColor(const Value *const Val) {
+ return (*this)[Val];
+ }
+
+
+};
+
+#endif