[llvm-commits] CVS: llvm/include/llvm/Target/MRegisterInfo.h
Alkis Evlogimenos
alkis at niobe.cs.uiuc.edu
Wed Feb 25 15:56:01 PST 2004
Changes in directory llvm/include/llvm/Target:
MRegisterInfo.h updated: 1.34 -> 1.35
---
Log message:
Add DenseMap template and actually use it for for mapping virtual regs
to objects.
---
Diffs of the changes: (+9 -1)
Index: llvm/include/llvm/Target/MRegisterInfo.h
diff -u llvm/include/llvm/Target/MRegisterInfo.h:1.34 llvm/include/llvm/Target/MRegisterInfo.h:1.35
--- llvm/include/llvm/Target/MRegisterInfo.h:1.34 Wed Feb 18 19:10:55 2004
+++ llvm/include/llvm/Target/MRegisterInfo.h Wed Feb 25 15:55:45 2004
@@ -16,8 +16,9 @@
#ifndef LLVM_TARGET_MREGISTERINFO_H
#define LLVM_TARGET_MREGISTERINFO_H
-#include <cassert>
#include "llvm/CodeGen/MachineBasicBlock.h"
+#include <cassert>
+#include <functional>
namespace llvm {
@@ -317,6 +318,13 @@
virtual void emitPrologue(MachineFunction &MF) const = 0;
virtual void emitEpilogue(MachineFunction &MF,
MachineBasicBlock &MBB) const = 0;
+};
+
+// This is useful when building DenseMap's keyed on virtual registers
+struct VirtReg2IndexFunctor : std::unary_function<unsigned, unsigned> {
+ unsigned operator()(unsigned Reg) const {
+ return Reg - MRegisterInfo::FirstVirtualRegister;
+ }
};
} // End llvm namespace
More information about the llvm-commits
mailing list