]> granicus.if.org Git - clang/commit
Produce a better diagnostic for global register variables.
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Nov 2015 00:15:28 +0000 (00:15 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 18 Nov 2015 00:15:28 +0000 (00:15 +0000)
commit66bf0e5936d767a8a3f441581a7b5d0f0842c7ba
tree57b5b72b5cf1d07c7b95a87c51602e77084e89a3
parentc6ed134ddd583541954a050b4236681b12971b50
Produce a better diagnostic for global register variables.

Currently, when there is a global register variable in a program that
is bound to an invalid register, clang/llvm prints an error message that
is not very user-friendly.

This commit improves the diagnostic and moves the check that used to be
in the backend to Sema. In addition, it makes changes to error out if
the size of the register doesn't match the declared variable size.

e.g., volatile register int B asm ("rbp");

rdar://problem/23084219

Differential Revision: http://reviews.llvm.org/D13834

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253405 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/TargetInfo.h
lib/Basic/Targets.cpp
lib/Sema/SemaDecl.cpp
test/CodeGen/named_reg_global.c
test/OpenMP/atomic_capture_codegen.cpp
test/OpenMP/atomic_read_codegen.c
test/OpenMP/atomic_update_codegen.cpp
test/OpenMP/atomic_write_codegen.c
test/OpenMP/for_loop_messages.cpp
test/OpenMP/threadprivate_messages.cpp
test/Sema/asm.c
test/SemaCUDA/asm-constraints-mixed.cu