Fixed bug with checking the kind of types.
authorChris Wailes <chris.wailes@gmail.com>
Thu, 31 Oct 2013 15:38:12 +0000 (15:38 +0000)
committerChris Wailes <chris.wailes@gmail.com>
Thu, 31 Oct 2013 15:38:12 +0000 (15:38 +0000)
commit1aa89697dc73760dce700e99d78c5805aa8bd7bb
tree3cd4f1382b353fb3a97b303d3d61ab3de8cc374b
parent3bb1b5c953fc38d4b87525258cf27b7c908988b1
Fixed bug with checking the kind of types.

The isLValueReferenceType function checks to see if the QualType's
canonical type is an LValue reference, and not if the QualType
itself is an LValue reference.  This caused a segfault when trying
to cast the QualType's Type to a LValueReference.  This is now
fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent
segfaults when a type being tested by the analysis is a reference
to a pointer or a pointer to a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193751 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/Consumed.cpp