]> granicus.if.org Git - clang/commit
[analyzer] Create a temporary region for rvalue structs when accessing fields
authorJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 17:15:12 +0000 (17:15 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 28 Sep 2012 17:15:12 +0000 (17:15 +0000)
commit6f61df3e7256413dcb99afb9673f4206e3c4992c
treed297501092690e7a5b0e044191966f655dc30960
parentda3d76b4cfbb5ebeb79e03a0abeabd403fe9260a
[analyzer] Create a temporary region for rvalue structs when accessing fields

Struct rvalues are represented in the analyzer by CompoundVals,
LazyCompoundVals, or plain ConjuredSymbols -- none of which have associated
regions. If the entire structure is going to persist, this is not a
problem -- either the rvalue will be assigned to an existing region, or
a MaterializeTemporaryExpr will be present to create a temporary region.
However, if we just need a field from the struct, we need to create the
temporary region ourselves.

This is inspired by the way CodeGen handles calls to temporaries;
support for that in the analyzer is coming next.

Part of <rdar://problem/12137950>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164828 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/ExprEngine.cpp
test/Analysis/fields.c
test/Analysis/reference.cpp