CGDecl::emitStoresForConstant fix synthesized constant's name
authorJF Bastien <jfbastien@apple.com>
Thu, 15 Nov 2018 00:19:18 +0000 (00:19 +0000)
committerJF Bastien <jfbastien@apple.com>
Thu, 15 Nov 2018 00:19:18 +0000 (00:19 +0000)
commit3a881e6bbcb06a7e753f88249a29d427ecce64c5
tree0017ed6e8adc60a88f22a6f5ef9a71d1ceaeac79
parent22bdb3310809d8d2055afc262a0aa81c06100447
CGDecl::emitStoresForConstant fix synthesized constant's name

Summary: The name of the synthesized constants for constant initialization was using mangling for statics, which isn't generally correct and (in a yet-uncommitted patch) causes the mangler to assert out because the static ends up trying to mangle function parameters and this makes no sense. Instead, mangle to `"__const." + FunctionName + "." + DeclName`.

Reviewers: rjmccall

Subscribers: dexonsmith, cfe-commits

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

llvm-svn: 346915
13 files changed:
clang/lib/CodeGen/CGDecl.cpp
clang/test/CodeGen/decl.c
clang/test/CodeGen/dump-struct-builtin.c
clang/test/CodeGenCXX/amdgcn-string-literal.cpp
clang/test/CodeGenCXX/const-init-cxx11.cpp
clang/test/CodeGenCXX/cxx2a-init-statement.cpp
clang/test/CodeGenCXX/float128-declarations.cpp
clang/test/CodeGenCXX/float16-declarations.cpp
clang/test/CodeGenOpenCL/amdgpu-nullptr.cl
clang/test/CodeGenOpenCL/constant-addr-space-globals.cl
clang/test/CodeGenOpenCL/partial_initializer.cl
clang/test/CodeGenOpenCL/private-array-initialization.cl
clang/test/Modules/templates.mm