[llvm-commits] [poolalloc] r107986 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
John Criswell
criswell at uiuc.edu
Fri Jul 9 09:35:30 PDT 2010
Author: criswell
Date: Fri Jul 9 11:35:30 2010
New Revision: 107986
URL: http://llvm.org/viewvc/llvm-project?rev=107986&view=rev
Log:
Modified the way we handle byval arguments so that we won't have strange errors
if they later alias a value that is not a byval argument.
Modified:
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=107986&r1=107985&r2=107986&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Fri Jul 9 11:35:30 2010
@@ -462,10 +462,26 @@
if (AI != G->getScalarMap().end()) {
if (DSNode *N = AI->second.getNode()) {
//
- // Add all nodes reachable from this parameter into our set of nodes
- // needing pools.
+ // If this is a byval argument, then simply add all DSNodes which are
+ // reachable from it, but don't add the byval argument's node. For
+ // all other parameters, add the DSNode for the parameter and all
+ // DSNodes reachable from it.
//
- N->markReachableNodes(MarkedNodes);
+ if (I->hasByValAttr()) {
+ DSNode::edge_iterator link = N->edge_begin();
+ while (link != N->edge_end()) {
+ DSNodeHandle Child = link->second;
+ if (Child.getNode())
+ Child.getNode()->markReachableNodes(MarkedNodes);
+ ++link;
+ }
+ } else {
+ //
+ // Add all nodes reachable from this parameter into our set of
+ // nodes needing pools.
+ //
+ N->markReachableNodes(MarkedNodes);
+ }
//
// If this is a byval argument, then we don't want to add it to the
More information about the llvm-commits
mailing list