aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/RegionStore.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-09-05 17:11:15 +0000
committerJordan Rose <jordan_rose@apple.com>2012-09-05 17:11:15 +0000
commitfd11957f02da689480618d5fc642ef14164e9cdc (patch)
treecaf99cc93fa3809106e055ec603a91b8ea0a249a /lib/StaticAnalyzer/Core/RegionStore.cpp
parenta78d0d6203a990b88c9c3e4c4f2a277001e8bd46 (diff)
Revert "[analyzer] Treat all struct values as regions (even rvalues)."
This turned out to have many implications, but what eventually seemed to make it unworkable was the fact that we can get struct values (as LazyCompoundVals) from other places besides return-by-value function calls; that is, we weren't actually able to "treat all struct values as regions" consistently across the entire analyzer core. Hopefully we'll be able to come up with an alternate solution soon. This reverts r163066 / 02df4f0aef142f00d4637cd851e54da2a123ca8e. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163218 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/RegionStore.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp
index 96342260a0..b3cf208000 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1744,26 +1744,6 @@ StoreRef RegionStoreManager::BindStruct(Store store, const TypedValueRegion* R,
if (!RD->isCompleteDefinition())
return StoreRef(store, *this);
- // Handle Loc values by automatically dereferencing the location.
- // This is necessary because we treat all struct values as regions even if
- // they are rvalues; we may then be asked to bind one of these
- // "rvalue regions" to an actual struct region.
- // (This is necessary for many of the test cases in array-struct-region.cpp.)
- //
- // This also handles the case of a struct argument passed by value to an
- // inlined function. In this case, the C++ standard says that the value
- // is copy-constructed into the parameter variable. However, the copy-
- // constructor is processed before we actually know if we're going to inline
- // the function, and thus we don't actually have the parameter's region
- // available. Instead, we use a temporary-object region, then copy the
- // bindings over by value.
- //
- // FIXME: This will be a problem when we handle the destructors of
- // temporaries; the inlined function will modify the parameter region,
- // but the destructor will act on the temporary region.
- if (const loc::MemRegionVal *MRV = dyn_cast<loc::MemRegionVal>(&V))
- V = getBinding(store, *MRV);
-
// Handle lazy compound values and symbolic values.
if (isa<nonloc::LazyCompoundVal>(V) || isa<nonloc::SymbolVal>(V))
return BindAggregate(store, R, V);