diff options
author | Lei Zhang <antiagainst@google.com> | 2017-10-25 12:15:51 -0400 |
---|---|---|
committer | Lei Zhang <antiagainst@google.com> | 2017-10-25 15:44:19 -0400 |
commit | 063dbea0f19a3926b81a34fa8dc5479fa7969739 (patch) | |
tree | 091ad795b5986d18f0f209661b0e5fc450d95417 /source/enum_string_mapping.h | |
parent | 90862fe4b1c6763b32ce683d2d32c2f281f577cf (diff) | |
download | spirv-tools-063dbea0f19a3926b81a34fa8dc5479fa7969739.tar.gz |
Turn all function static non-POD variables into global POD variables
Function static non-POD data causes problems with DLL lifetime.
This pull request turns all static info tables into strict POD
tables. Specifically, the capabilities/extensions field of
opcode/operand/extended-instruction table are turned into two
fields, one for the count and the other a pointer to an array of
capabilities/extensions. CapabilitySet/EnumSet are not used in
the static table anymore, but they are still used for checking
inclusion by constructing on the fly, which should be cheap for
the majority cases.
Also moves all these tables into the global namespace to avoid
C++11 function static thread-safe initialization overhead.
Diffstat (limited to 'source/enum_string_mapping.h')
-rw-r--r-- | source/enum_string_mapping.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/enum_string_mapping.h b/source/enum_string_mapping.h index 773d40c4..c9ac58ad 100644 --- a/source/enum_string_mapping.h +++ b/source/enum_string_mapping.h @@ -19,9 +19,9 @@ #include "spirv/1.1/spirv.h" -namespace libspirv { +#include "extensions.h" -enum class Extension; +namespace libspirv { // Finds Extension enum corresponding to |str|. Returns false if not found. bool GetExtensionFromString(const std::string& str, Extension* extension); |