From a09451cc7b86bf49a2ad71563fb57b5c960d2048 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 27 Apr 2002 02:27:11 +0000 Subject: [PATCH] Support array allocations llvm-svn: 2326 --- llvm/include/llvm/Analysis/DataStructure.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/Analysis/DataStructure.h b/llvm/include/llvm/Analysis/DataStructure.h index 0474da11d1f8..2d21545aebba 100644 --- a/llvm/include/llvm/Analysis/DataStructure.h +++ b/llvm/include/llvm/Analysis/DataStructure.h @@ -180,6 +180,7 @@ public: // isEquivalentTo - Return true if the nodes should be merged... virtual bool isEquivalentTo(DSNode *Node) const = 0; + virtual void mergeInto(DSNode *Node) const {} DSNode *clone() const { DSNode *New = cloneImpl(); @@ -210,8 +211,9 @@ protected: // class AllocDSNode : public DSNode { AllocationInst *Allocation; + bool isVarSize; // Allocating variable sized objects public: - AllocDSNode(AllocationInst *V); + AllocDSNode(AllocationInst *V, bool isVarSize = false); virtual std::string getCaption() const; @@ -219,15 +221,18 @@ public: bool isMallocNode() const { return !isAllocaNode(); } AllocationInst *getAllocation() const { return Allocation; } + bool isVariableSize() const { return isVarSize; } // isEquivalentTo - Return true if the nodes should be merged... virtual bool isEquivalentTo(DSNode *Node) const; + virtual void mergeInto(DSNode *Node) const; // Support type inquiry through isa, cast, and dyn_cast... static bool classof(const AllocDSNode *) { return true; } static bool classof(const DSNode *N) { return N->NodeType == NewNode; } protected: - virtual AllocDSNode *cloneImpl() const { return new AllocDSNode(Allocation); } + virtual AllocDSNode *cloneImpl() const { return new AllocDSNode(Allocation, + isVarSize); } };