[FE] Manipulate the first byte of guard variable type in both load and store operation
authorXiangling Liao <Xiangling.Liao@ibm.com>
Mon, 8 Feb 2021 16:14:23 +0000 (11:14 -0500)
committerXiangling Liao <Xiangling.Liao@ibm.com>
Mon, 8 Feb 2021 16:14:34 +0000 (11:14 -0500)
commit6b1e2fc89327a64c9300d543e00f12435c32dfcf
tree523eb9f84afc2f33b01698bc73b2d71e3afd25af
parentecc8ac3f081b57c25b94a69a04b3088f22a2794f
[FE] Manipulate the first byte of guard variable type in both load and store operation

As Itanium ABI[http://itanium-cxx-abi.github.io/cxx-abi/abi.html#once-ctor]
points out:

"The size of the guard variable is 64 bits. The first byte (i.e. the byte at
the address of the full variable) shall contain the value 0 prior to
initialization of the associated variable, and 1 after initialization is complete."

Differential Revision: https://reviews.llvm.org/D95822
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/test/CodeGenCXX/aix-static-init-temp-spec-and-inline-var.cpp
clang/test/CodeGenCXX/aix-static-init.cpp
clang/test/CodeGenCXX/cxx11-thread-local.cpp
clang/test/CodeGenCXX/global-init.cpp
clang/test/CodeGenCXX/static-data-member.cpp