[PATCH] D28212: typeinfo: provide a partial implementation for Win32
Shoaib Meenai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 14 20:33:46 PDT 2017
smeenai added inline comments.
================
Comment at: include/typeinfo:100
+ int __compare(const struct type_info &__rhs);
+#endif // _LIBCPP_ABI_MICROSOFT
+
----------------
Drop the `struct`; it causes compilation errors.
This needs to be marked `const`.
================
Comment at: src/typeinfo.cpp:15
+ if (&__data == &__rhs.__data)
+ return 0;
+ return strcmp(&__data.__decorated_name[1], &__rhs.__data.__decorated_name[1]);
----------------
Drop the `struct` and add the `const`.
================
Comment at: src/typeinfo.cpp:21
+ // TODO(compnerd) cache demangled &__data.__decorated_name[1]
+ return &__data.__decorated_name[1];
+}
----------------
You need a `const` here.
================
Comment at: src/typeinfo.cpp:36
+ value ^= static_cast<size_t>(static_cast<unsigned char>(*c));
+ value *= fnv_prime;
+ }
----------------
The `->` should be `.`
https://reviews.llvm.org/D28212
More information about the cfe-commits
mailing list