]> granicus.if.org Git - clang/commit
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic
authorYonghong Song <yhs@fb.com>
Mon, 15 Jul 2019 15:42:41 +0000 (15:42 +0000)
committerYonghong Song <yhs@fb.com>
Mon, 15 Jul 2019 15:42:41 +0000 (15:42 +0000)
commit2a9412eebe35a77d52638843d4a5a8ef480bc5d8
tree62e86124196440c3b02b28842ce3a0a0d9b9fb3a
parentb946da5a6054247c34fe82f075f4c3a143445026
fix unnamed fiefield issue and add tests for __builtin_preserve_access_index intrinsic

This is a followup patch for https://reviews.llvm.org/D61809.
Handle unnamed bitfield properly and add more test cases.

Fixed the unnamed bitfield issue. The unnamed bitfield is ignored
by debug info, so we need to ignore such a struct/union member
when we try to get the member index in the debug info.

D61809 contains two test cases but not enough as it does
not checking generated IRs in the fine grain level, and also
it does not have semantics checking tests.
This patch added unit tests for both code gen and semantics checking for
the new intrinsic.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366076 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGen/builtin-preserve-access-index.c [new file with mode: 0644]
test/Sema/builtin-preserve-access-index.c [new file with mode: 0644]