[PATCH] D87974: Summary: [Builtin] Add __builtin_zero_non_value_bits.
JF Bastien via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 19 16:14:14 PDT 2020
jfb added inline comments.
================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:1682
+
+ size_t NumFeilds = std::distance(R->field_begin(), R->field_end());
+ auto CurrentField = R->field_begin();
----------------
Typo in "fields".
================
Comment at: clang/test/CodeGenCXX/builtin-zero-non-value-bits.cpp:160
+
+int main() {
+ testAllForType<32, 16, char>(11, 22, 33, 44);
----------------
Usually CodeGen tests will use lit to check the emitted IR matches expectations. I think that's what you want to do here.
Remember to test `volatile` qualified pointers, as well as address spaces too.
================
Comment at: clang/test/SemaCXX/builtin-zero-non-value-bits.cpp:11
+ __builtin_zero_non_value_bits(e); // This should not error.
+}
----------------
You should also check incomplete types, vector, variable width integers, `const` qualified.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87974/new/
https://reviews.llvm.org/D87974
More information about the cfe-commits
mailing list