[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineInstr.h

Chris Lattner lattner at cs.uiuc.edu
Tue Feb 10 15:22:01 PST 2004


Changes in directory llvm/include/llvm/CodeGen:

MachineInstr.h updated: 1.124 -> 1.125

---
Log message:

Remove and simplify some of the bewildering collection of isFOORegister
methods which have strangely different semantics in different backends,
and noone knew what any did.

Getting rid of these ALSO allows the dependence of MachineInstr.h on
MRegisterInfo.h to be removed, which makes me much happier, and probably
alkis too.  :)



---
Diffs of the changes:  (+8 -14)

Index: llvm/include/llvm/CodeGen/MachineInstr.h
diff -u llvm/include/llvm/CodeGen/MachineInstr.h:1.124 llvm/include/llvm/CodeGen/MachineInstr.h:1.125
--- llvm/include/llvm/CodeGen/MachineInstr.h:1.124	Tue Feb 10 14:42:11 2004
+++ llvm/include/llvm/CodeGen/MachineInstr.h	Tue Feb 10 15:21:17 2004
@@ -16,9 +16,9 @@
 #ifndef LLVM_CODEGEN_MACHINEINSTR_H
 #define LLVM_CODEGEN_MACHINEINSTR_H
 
-#include "llvm/Target/MRegisterInfo.h"
 #include "Support/Annotation.h"
 #include "Support/iterator"
+#include <vector>
 
 namespace llvm {
 
@@ -220,19 +220,13 @@
   bool isPCRelative() const { return (flags & PCRELATIVE) != 0; }
 
 
-  // This is to finally stop caring whether we have a virtual or machine
-  // register -- an easier interface is to simply call both virtual and machine
-  // registers essentially the same, yet be able to distinguish when
-  // necessary. Thus the instruction selector can just add registers without
-  // abandon, and the register allocator won't be confused.
-  bool isVirtualRegister() const {
-    return (opType == MO_VirtualRegister || opType == MO_MachineRegister) 
-      && regNum >= MRegisterInfo::FirstVirtualRegister;
-  }
-  bool isRegister() const {
-    return opType == MO_VirtualRegister || opType == MO_MachineRegister;
-  }
-  bool isMachineRegister() const { return !isVirtualRegister(); }
+  /// isRegister - Return true if this operand is a register operand.
+  ///
+  /// Note: In the sparc backend, this only returns true for "machine
+  /// registers", not for "virtual registers".
+  ///
+  bool isRegister() const { return opType == MO_MachineRegister; }
+
   bool isMachineBasicBlock() const { return opType == MO_MachineBasicBlock; }
   bool isPCRelativeDisp() const { return opType == MO_PCRelativeDisp; }
   bool isImmediate() const {





More information about the llvm-commits mailing list