diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-02 00:11:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-02 00:11:12 +0000 |
commit | 332043264ee52b171b9164ae9c454b9ebe9e9f04 (patch) | |
tree | 3153f5efdcc164da6108145be5b62cc0fdc63838 /include | |
parent | 7e9fea736dd0c4d961b159ada205cafbcb4b68cf (diff) | |
download | llvm-332043264ee52b171b9164ae9c454b9ebe9e9f04.tar.gz llvm-332043264ee52b171b9164ae9c454b9ebe9e9f04.tar.bz2 llvm-332043264ee52b171b9164ae9c454b9ebe9e9f04.tar.xz |
* Eliminate Scalar node type (renumber other node types)
* Allow DSNodeHandle::mergeWith to work if a node handle isn't pointing to a node yet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DSNode.h | 20 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSNode.h | 20 |
2 files changed, 22 insertions, 18 deletions
diff --git a/include/llvm/Analysis/DSNode.h b/include/llvm/Analysis/DSNode.h index 1050ca738c..0d5a0dfa38 100644 --- a/include/llvm/Analysis/DSNode.h +++ b/include/llvm/Analysis/DSNode.h @@ -62,13 +62,12 @@ class DSNode { public: enum NodeTy { ShadowNode = 0, // Nothing is known about this node... - ScalarNode = 1 << 0, // Scalar of the current function contains this value - AllocaNode = 1 << 1, // This node was allocated with alloca - 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 + AllocaNode = 1 << 0, // This node was allocated with alloca + NewNode = 1 << 1, // This node was allocated with malloc + GlobalNode = 1 << 2, // This node was allocated by a global var decl + Incomplete = 1 << 3, // This node may not be complete + Modified = 1 << 4, // This node is modified in this context + Read = 1 << 5, // This node is read in this context }; /// NodeType - A union of the above bits. "Shadow" nodes do not add any flags @@ -294,8 +293,11 @@ inline void DSNodeHandle::addEdgeTo(unsigned LinkNo, const DSNodeHandle &Node) { /// pointed to by 'N'. /// inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) { - assert(N && "DSNodeHandle does not point to a node yet!"); - N->mergeWith(Node, Offset); + if (N != 0) + N->mergeWith(Node, Offset); + else { // No node to merge with, so just point to Node + *this = Node; + } } #endif diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index 1050ca738c..0d5a0dfa38 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -62,13 +62,12 @@ class DSNode { public: enum NodeTy { ShadowNode = 0, // Nothing is known about this node... - ScalarNode = 1 << 0, // Scalar of the current function contains this value - AllocaNode = 1 << 1, // This node was allocated with alloca - 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 + AllocaNode = 1 << 0, // This node was allocated with alloca + NewNode = 1 << 1, // This node was allocated with malloc + GlobalNode = 1 << 2, // This node was allocated by a global var decl + Incomplete = 1 << 3, // This node may not be complete + Modified = 1 << 4, // This node is modified in this context + Read = 1 << 5, // This node is read in this context }; /// NodeType - A union of the above bits. "Shadow" nodes do not add any flags @@ -294,8 +293,11 @@ inline void DSNodeHandle::addEdgeTo(unsigned LinkNo, const DSNodeHandle &Node) { /// pointed to by 'N'. /// inline void DSNodeHandle::mergeWith(const DSNodeHandle &Node) { - assert(N && "DSNodeHandle does not point to a node yet!"); - N->mergeWith(Node, Offset); + if (N != 0) + N->mergeWith(Node, Offset); + else { // No node to merge with, so just point to Node + *this = Node; + } } #endif |