[llvm-commits] [llvm] r46128 - /llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Chris Lattner sabre at nondot.org
Wed Jan 16 23:30:39 PST 2008


Author: lattner
Date: Thu Jan 17 01:30:38 2008
New Revision: 46128

URL: http://llvm.org/viewvc/llvm-project?rev=46128&view=rev
Log:
add some helper methods.

Modified:
    llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h?rev=46128&r1=46127&r2=46128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAGNodes.h Thu Jan 17 01:30:38 2008
@@ -1562,6 +1562,12 @@
   ISD::LoadExtType getExtensionType() const { return ExtType; }
   MVT::ValueType getLoadedVT() const { return LoadedVT; }
 
+  /// isIndexed - Return true if this is a pre/post inc/dec load.
+  bool isIndexed() const { return AddrMode != ISD::UNINDEXED; }
+  
+  /// isUnindexed - Return true if this is NOT a pre/post inc/dec load.
+  bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
+  
   static bool classof(const LoadSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::LOAD;
@@ -1594,16 +1600,21 @@
     Ops[3] = ChainValuePtrOff[3]; // Off
     InitOperands(Ops, 4);
     assert(Align != 0 && "Stores should have non-zero aligment");
-    assert((getOffset().getOpcode() == ISD::UNDEF || 
-            AddrMode != ISD::UNINDEXED) &&
+    assert((getOffset().getOpcode() == ISD::UNDEF || isIndexed()) &&
            "Only indexed store has a non-undef offset operand");
   }
 public:
 
-  ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
   bool isTruncatingStore() const { return IsTruncStore; }
   MVT::ValueType getStoredVT() const { return StoredVT; }
+  ISD::MemIndexedMode getAddressingMode() const { return AddrMode; }
+
+  /// isIndexed - Return true if this is a pre/post inc/dec store.
+  bool isIndexed() const { return AddrMode != ISD::UNINDEXED; }
 
+  /// isUnindexed - Return true if this is NOT a pre/post inc/dec store.
+  bool isUnindexed() const { return AddrMode == ISD::UNINDEXED; }
+  
   static bool classof(const StoreSDNode *) { return true; }
   static bool classof(const SDNode *N) {
     return N->getOpcode() == ISD::STORE;





More information about the llvm-commits mailing list