diff options
author | 2017-11-13 15:00:07 -0800 | |
---|---|---|
committer | 2017-11-13 15:04:33 -0800 | |
commit | 7d197b3ab4b5389c19ab7742cf5d473d5fa91b08 (patch) | |
tree | 640dafb9ef9e9250a61b9921b51c603b1241aa85 /tensorflow/cc/framework | |
parent | 061c3597b84d45a9878b8adf831e39a5573859ec (diff) |
Automated g4 rollback of changelist 175563786
PiperOrigin-RevId: 175593063
Diffstat (limited to 'tensorflow/cc/framework')
-rw-r--r-- | tensorflow/cc/framework/cc_op_gen.cc | 119 |
1 files changed, 18 insertions, 101 deletions
diff --git a/tensorflow/cc/framework/cc_op_gen.cc b/tensorflow/cc/framework/cc_op_gen.cc index 7a1b2a012d..38a17598b8 100644 --- a/tensorflow/cc/framework/cc_op_gen.cc +++ b/tensorflow/cc/framework/cc_op_gen.cc @@ -297,7 +297,7 @@ string ToCamelCase(const string& str) { // argument to a function. std::pair<const char*, bool> AttrTypeName(StringPiece attr_type) { static const std::unordered_map<StringPiece, std::pair<const char*, bool>, - StringPieceHasher> + StringPiece::Hasher> attr_type_map{ {"string", {"StringPiece", false}}, {"list(string)", {"gtl::ArraySlice<string>", true}}, @@ -325,112 +325,29 @@ std::pair<const char*, bool> AttrTypeName(StringPiece attr_type) { } bool IsCPPKeyword(StringPiece name) { - static const std::unordered_set<StringPiece, StringPieceHasher> + static const std::unordered_set<StringPiece, StringPiece::Hasher> // Keywords obtained from http://en.cppreference.com/w/cpp/keyword kCPPReserved{ - "alignas", - "alignof", - "and", - "and_eq", - "asm", - "atomic_cancel", - "atomic_commit", - "atomic_noexcept", - "auto", - "bitand", - "bitor", - "bool", - "break", - "case", - "catch", - "char", - "char16_t", - "char32_t", - "class", - "compl", - "concept", - "const", - "const_cast", - "constexpr", - "continue", - "decltype", - "default", - "delete", - "do", - "double", - "dynamic_cast", - "else", - "enum", - "explicit", - "export", - "extern", - "false", - "final", - "float", - "for", - "friend", - "goto", - "if", - "import", - "inline", - "int", - "long", - "module", - "mutable", - "namespace", - "new", - "noexcept", - "not", - "not_eq", - "nullptr", - "operator", - "or", - "or_eq", - "override", - "private", - "protected", - "public", - "register", - "reinterpret_cast", - "requires", - "return", - "short", - "signed", - "sizeof", - "static", - "static_assert", - "static_cast", - "struct", - "switch", - "synchronized", - "template", - "this", - "thread_local", - "throw", - "true", - "try", - "typedef", - "typeid", - "typename", - "union", - "unsigned", - "using", - "virtual", - "void", - "volatile", - "wchar_t", - "while", - "xor", - "xor_eq", + "alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", + "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "bool", + "break", "case", "catch", "char", "char16_t", "char32_t", "class", + "compl", "concept", "const", "const_cast", "constexpr", "continue", + "decltype", "default", "delete", "do", "double", "dynamic_cast", + "else", "enum", "explicit", "export", "extern", "false", "final", + "float", "for", "friend", "goto", "if", "import", "inline", "int", + "long", "module", "mutable", "namespace", "new", "noexcept", "not", + "not_eq", "nullptr", "operator", "or", "or_eq", "override", "private", + "protected", "public", "register", "reinterpret_cast", "requires", + "return", "short", "signed", "sizeof", "static", "static_assert", + "static_cast", "struct", "switch", "synchronized", "template", "this", + "thread_local", "throw", "true", "try", "typedef", "typeid", + "typename", "union", "unsigned", "using", "virtual", "void", + "volatile", "wchar_t", "while", "xor", "xor_eq", // The following are not C++ keywords, but names of local variables // and parameters used in the op constructor. Treating them as // keywords, so that other parameter names don't conflict with these. - "builder", - "node", - "ret", - "scope", - "unique_name", + "builder", "node", "ret", "scope", "unique_name", }; return kCPPReserved.count(name) > 0; } |