This is a follow up on D61634 and the last step to implement http://lists.llvm.org/pipermail/llvm-dev/2019-April/131973.html
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
1653 | SemaBuiltinConstantArg. Or actually, you should probably use "I" in Builtins.def. |
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2251 | This is in the wrong section of the documentation. We could constant-evaluate __builtin_memcpy_inline, I guess, but that isn't the primary purpose, and your patch doesn't implement constant evaluation anyway. Might make sense to add a new section, if no existing section makes sense. |
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
1655 | You can EvaluateKnownConstInt here, instead of isIntegerConstantExpr. |
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2251 | I added a new memory builtins section. Let me know what you think. |
Sorry about the delayed response, I was traveling.
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2229 | Not sure putting "memcpy" in this list makes sense. We did add support for constant-evaluating memcpy, but it was separately from the others, so the description of the feature detection is wrong. | |
2251 | Makes sense. |
- Remove unrelated memcpy in documentation
clang/docs/LanguageExtensions.rst | ||
---|---|---|
2229 | Actually this is unrelated to this patch. The documentation is missing memcpy as a string builtin. It should go in a separate patch though. |
clang/test/Sema/builtins-memcpy-inline.c | ||
---|---|---|
7 | It appears that the expected-warning check here is guarded by the #if as well. Moving it after the #endif results in a failing test. I noticed this as I was trying to use has_feature(builtin_memcpy_inline), but it somehow does not work, even though the compiler clearly supports __builtin_memcpy_inline. Any idea what's wrong with the __has_feature test? Thanks! |
clang/test/Sema/builtins-memcpy-inline.c | ||
---|---|---|
7 | Should be __has_builtin, I think? __has_feature only applies to features defined in clang/include/clang/Basic/Features.def. |
clang/test/Sema/builtins-memcpy-inline.c | ||
---|---|---|
7 | Thx for noticing. I'll send a patch to update the test. |
clang/test/Sema/builtins-memcpy-inline.c | ||
---|---|---|
7 | Submitted as rG12c8e3632edda3bc640867ba326b52b5b2220a57 |
Not sure putting "memcpy" in this list makes sense. We did add support for constant-evaluating memcpy, but it was separately from the others, so the description of the feature detection is wrong.