]> granicus.if.org Git - clang/commit
Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of...
authorWei Mi <wmi@google.com>
Mon, 25 Sep 2017 19:57:59 +0000 (19:57 +0000)
committerWei Mi <wmi@google.com>
Mon, 25 Sep 2017 19:57:59 +0000 (19:57 +0000)
commit5572f1b64d86ea308afb43ce60ee66b66ab0c88e
treeeb38aba2bee9a96c38bcbdd8394f1f9038eb50a8
parent2d4bdbc5f5c3abfa1a1e6c2f900dce6dd66ca810
Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr" after fixing PR31620.

This is to fix PR34347. EmitAtomicExpr now only uses alignment information from
Type, instead of Decl, so when the declaration of an atomic variable is marked
to have the alignment equal as its size, EmitAtomicExpr doesn't know about it and
will generate libcall instead of atomic op. The patch uses EmitPointerWithAlignment
to get the precise alignment information.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314145 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGAtomic.cpp
test/CodeGenCXX/atomic-align.cpp [new file with mode: 0644]