[DebugInfo] Add support for __fp16, float, and double constants.
authorDavid Gross <dgross@google.com>
Thu, 8 Dec 2016 20:02:46 +0000 (20:02 +0000)
committerDavid Gross <dgross@google.com>
Thu, 8 Dec 2016 20:02:46 +0000 (20:02 +0000)
commit1118d591dc3f2e0499ac2fdd61f934cab895283b
treed0c2521b4dfbb2173b3fb5a7596f86259e1c547b
parent6c06a6f48a10ab242f64cd9a95942abb87117832
[DebugInfo] Add support for __fp16, float, and double constants.

Summary:
Partial fix for PR26619.

Prior to this change, a DIGlobalVariable corresponding to a static
const was marked with an expression corresponding to its constant
value only if it is of integral type.  With this change, we now do the
same if it is of __fp16, float, or double type (that is,
floating-point types that do not exceed 64 bits in size, and hence are
supported easily by the existing LLVM machinery for creating constant
expressions in debug info).

Reviewers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27549

llvm-svn: 289094
clang/lib/CodeGen/CGDebugInfo.cpp
clang/test/CodeGen/debug-info-static-const-fp.c [new file with mode: 0644]