Add interface for mod/ref info to be captures by dsgraphs
authorChris Lattner <sabre@nondot.org>
Thu, 17 Oct 2002 21:03:49 +0000 (21:03 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Oct 2002 21:03:49 +0000 (21:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4222 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSGraph.h
include/llvm/Analysis/DataStructure/DSGraph.h

index fce442ebc5f7ff29ab20c40d1a756c59c3b4cea4..fb2f28bc1a0b69186173ffa584ef81124e16eb8f 100644 (file)
@@ -136,6 +136,8 @@ public:
     NewNode    = 1 << 2,   // This node was allocated with malloc
     GlobalNode = 1 << 3,   // This node was allocated by a global var decl
     Incomplete = 1 << 4,   // This node may not be complete
+    Modified   = 1 << 5,   // This node is modified in this context
+    Read       = 1 << 6,   // This node is read in this context
   };
   
   /// NodeType - A union of the above bits.  "Shadow" nodes do not add any flags
@@ -164,15 +166,25 @@ public:
   //===--------------------------------------------------
   // Accessors
 
-  // getSize - Return the maximum number of bytes occupied by this object...
+  /// getSize - Return the maximum number of bytes occupied by this object...
+  ///
   unsigned getSize() const { return MergeMap.size(); }
 
   // getTypeEntries - Return the possible types and their offsets in this object
   const std::vector<TypeRec> &getTypeEntries() const { return TypeEntries; }
 
-  // getReferrers - Return a list of the pointers to this node...
+  /// getReferrers - Return a list of the pointers to this node...
+  ///
   const std::vector<DSNodeHandle*> &getReferrers() const { return Referrers; }
 
+  /// isModified - Return true if this node may be modified in this context
+  ///
+  bool isModified() const { return (NodeType & Modified) != 0; }
+
+  /// isRead - Return true if this node may be read in this context
+  ///
+  bool isRead() const { return (NodeType & Read) != 0; }
+
 
   /// hasLink - Return true if this memory object has a link at the specified
   /// location.
index fce442ebc5f7ff29ab20c40d1a756c59c3b4cea4..fb2f28bc1a0b69186173ffa584ef81124e16eb8f 100644 (file)
@@ -136,6 +136,8 @@ public:
     NewNode    = 1 << 2,   // This node was allocated with malloc
     GlobalNode = 1 << 3,   // This node was allocated by a global var decl
     Incomplete = 1 << 4,   // This node may not be complete
+    Modified   = 1 << 5,   // This node is modified in this context
+    Read       = 1 << 6,   // This node is read in this context
   };
   
   /// NodeType - A union of the above bits.  "Shadow" nodes do not add any flags
@@ -164,15 +166,25 @@ public:
   //===--------------------------------------------------
   // Accessors
 
-  // getSize - Return the maximum number of bytes occupied by this object...
+  /// getSize - Return the maximum number of bytes occupied by this object...
+  ///
   unsigned getSize() const { return MergeMap.size(); }
 
   // getTypeEntries - Return the possible types and their offsets in this object
   const std::vector<TypeRec> &getTypeEntries() const { return TypeEntries; }
 
-  // getReferrers - Return a list of the pointers to this node...
+  /// getReferrers - Return a list of the pointers to this node...
+  ///
   const std::vector<DSNodeHandle*> &getReferrers() const { return Referrers; }
 
+  /// isModified - Return true if this node may be modified in this context
+  ///
+  bool isModified() const { return (NodeType & Modified) != 0; }
+
+  /// isRead - Return true if this node may be read in this context
+  ///
+  bool isRead() const { return (NodeType & Read) != 0; }
+
 
   /// hasLink - Return true if this memory object has a link at the specified
   /// location.