diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-04 22:27:30 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-04 22:27:30 +0000 |
commit | eb3cad53e7e81be2738ef1ab24b101c3a2745e6c (patch) | |
tree | 52bcb9d4c5a9e63daf9b42b5f6d698aa72865618 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | |
parent | 06caff46c05e407d89306001ea96f1e53cf20b13 (diff) | |
download | bcm5719-llvm-eb3cad53e7e81be2738ef1ab24b101c3a2745e6c.tar.gz bcm5719-llvm-eb3cad53e7e81be2738ef1ab24b101c3a2745e6c.zip |
Add a warning for when an array-to-pointer decay is performed on an array
temporary or an array subobject of a class temporary, and the resulting value
is used to initialize a pointer which outlives the temporary. Such a pointer
is always left dangling after the initialization completes and the array's
lifetime ends.
In order to detect this situation, this change also adds an
LValueClassification of LV_ArrayTemporary for temporaries of array type which
aren't subobjects of class temporaries. These occur in C++11 T{...} and GNU C++
(T){...} expressions, when T is an array type. Previously we treated the former
as a generic prvalue and the latter as a class temporary.
llvm-svn: 157955
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions