diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-06 06:20:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-06 06:20:27 +0000 |
commit | 08db719c4b1134746da5d03b22f0da4050c91f99 (patch) | |
tree | 89433bb3d0f5552f6819e65aef467ed1531f529e /include/llvm/Analysis/DataStructure/DSSupport.h | |
parent | 4268c93b0082509f96dea6e3934c6306ab7da2ee (diff) | |
download | external_llvm-08db719c4b1134746da5d03b22f0da4050c91f99.zip external_llvm-08db719c4b1134746da5d03b22f0da4050c91f99.tar.gz external_llvm-08db719c4b1134746da5d03b22f0da4050c91f99.tar.bz2 |
Dramatically simplify internal DSNode representation, get implementation
*FULLY OPERATIONAL* and safe. We are now capable of completely analyzing
at LEAST the Olden benchmarks + 181.mcf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DSSupport.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index ae1e815..acaac37 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -22,6 +22,10 @@ class DSNode; // Each node in the graph class DSGraph; // A graph for a function class DSNodeIterator; // Data structure graph traversal iterator +namespace DS { + extern const unsigned PointerShift; // 64bit ptrs = 3, 32 bit ptrs = 2 +}; + //===----------------------------------------------------------------------===// /// DSNodeHandle - Implement a "handle" to a data structure node that takes care /// of all of the add/un'refing of the node to prevent the backpointers in the @@ -32,6 +36,7 @@ class DSNodeIterator; // Data structure graph traversal iterator /// defined in DSNode.h because they need knowledge of DSNode operation. Putting /// them in a CPP file wouldn't help making them inlined and keeping DSNode and /// DSNodeHandle (and friends) in one file complicates things. +/// class DSNodeHandle { DSNode *N; unsigned Offset; @@ -77,8 +82,8 @@ public: /// getLink - Treat this current node pointer as a pointer to a structure of /// some sort. This method will return the pointer a mem[this+Num] /// - inline const DSNodeHandle *getLink(unsigned Num) const; - inline DSNodeHandle *getLink(unsigned Num); + inline const DSNodeHandle &getLink(unsigned Num) const; + inline DSNodeHandle &getLink(unsigned Num); inline void setLink(unsigned Num, const DSNodeHandle &NH); }; @@ -90,26 +95,14 @@ public: /// struct DSTypeRec { const Type *Ty; // The type itself... - unsigned Offset; // The offset in the node bool isArray; // Have we accessed an array of elements? - DSTypeRec() : Ty(0), Offset(0), isArray(false) {} - DSTypeRec(const Type *T, unsigned O) : Ty(T), Offset(O), isArray(false) {} - - bool operator<(const DSTypeRec &TR) const { - // Sort first by offset! - return Offset < TR.Offset || (Offset == TR.Offset && Ty < TR.Ty); - } - bool operator==(const DSTypeRec &TR) const { - return Ty == TR.Ty && Offset == TR.Offset; - } - bool operator!=(const DSTypeRec &TR) const { return !operator==(TR); } + DSTypeRec(const Type *T = 0, bool A = false) + : Ty(T), isArray(A) {} }; - - //===----------------------------------------------------------------------===// /// DSCallSite - Representation of a call site via its call instruction, /// the DSNode handle for the callee function (or function pointer), and |