[cfe-commits] r74525 - in /cfe/trunk/lib/Analysis: Environment.cpp LiveVariables.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Tue Jun 30 06:01:15 PDT 2009
Author: zhongxingxu
Date: Tue Jun 30 08:00:53 2009
New Revision: 74525
URL: http://llvm.org/viewvc/llvm-project?rev=74525&view=rev
Log:
Instead of r74522, use another approach to fix xfail_regionstore_wine_crash.c.
Mark the super region of the binding of block level expr in the Environment
as live.
Modified:
cfe/trunk/lib/Analysis/Environment.cpp
cfe/trunk/lib/Analysis/LiveVariables.cpp
Modified: cfe/trunk/lib/Analysis/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/Environment.cpp?rev=74525&r1=74524&r2=74525&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/Environment.cpp (original)
+++ cfe/trunk/lib/Analysis/Environment.cpp Tue Jun 30 08:00:53 2009
@@ -143,8 +143,17 @@
SVal X = I.getData();
// If the block expr's value is a memory region, then mark that region.
- if (isa<loc::MemRegionVal>(X))
- DRoots.push_back(cast<loc::MemRegionVal>(X).getRegion());
+ if (isa<loc::MemRegionVal>(X)) {
+ const MemRegion* R = cast<loc::MemRegionVal>(X).getRegion();
+ DRoots.push_back(R);
+ // Mark the super region of the RX as live.
+ // e.g.: int x; char *y = (char*) &x; if (*y) ...
+ // 'y' => element region. 'x' is its super region.
+ // We only add one level super region for now.
+ if (const SubRegion *SR = dyn_cast<SubRegion>(R)) {
+ DRoots.push_back(SR->getSuperRegion());
+ }
+ }
// Mark all symbols in the block expr's value live.
MarkLiveCallback cb(SymReaper);
Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=74525&r1=74524&r2=74525&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)
+++ cfe/trunk/lib/Analysis/LiveVariables.cpp Tue Jun 30 08:00:53 2009
@@ -138,7 +138,6 @@
else {
// For block-level expressions, mark that they are live.
LiveState(S,AD) = Alive;
- StmtVisitor<TransferFuncs,void>::Visit(S);
}
}
More information about the cfe-commits
mailing list