OSDN Git Service

Ensure NoDefinitions gets initialized only at first use.
authorNicolas Capens <capn@google.com>
Thu, 8 Sep 2016 16:47:42 +0000 (12:47 -0400)
committerNicolas Capens <nicolascapens@google.com>
Fri, 9 Sep 2016 14:13:28 +0000 (14:13 +0000)
commit86e5d883047328790dd7e1931c3cd112765560d7
tree07ce6db63d112e621207405fb866cd9f42c1d243
parent0e137b2e9d2341c741bca8968a65646c1a3f547c
Ensure NoDefinitions gets initialized only at first use.

As a global, NoDefinitions could get initialized at program startup,
which happens specifically with Visual Studio. This causes the
progam to abort because its initialization depends on a TLS variable
to be (manually) initialized first. Since there's only one use of
NoDefinitions, it can be moved to that location and since it's at
function scope it only gets constructed at first use.

BUG=swiftshader:7

Change-Id: I30801ad0d0ab380ead33069f174bb78dc1b230ab
Reviewed-on: https://chromium-review.googlesource.com/379955
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Jim Stichnoth <stichnot@chromium.org>
src/IceOperand.cpp
src/IceOperand.h