[llvm-commits] [cfe-commits] [PATCH][Review Request] EarlyCSE stack overflow - bugzilla 11794
Jakob Stoklund Olesen
stoklund at 2pi.dk
Mon Jan 30 13:05:55 CST 2012
On Jan 30, 2012, at 10:51 AM, Lenny Maiorani wrote:
> I am getting back to this and it looks like I will need to store the 3 ScopedHashTable objects. I am considering doing this via an IntrusiveRefCntPtr since I will need to store them in the local stack along with the generation and node and each scope might have multiple instances, one instance per child node. Is it preferred to have ScopedHashTable directly inherit from RefCountedBase (making all instances of ScopedHashTable have RefCountedBase) or create a new class within EarlyCSE which inherits and use a naked ptr to the ScopedHashTable inside that class?
I really don't think you need reference counting to do this. A simple tree traversal with a stack on the side will do.
Make sure you know the fundamental difference between the tree traversal code you posted earlier and the algorithm used by DepthFirstIterator.h. You need the latter.
More information about the llvm-commits