6 ms·
The compiler will surely use a (most likely intrinsic) function with appropriate semantics in that case.
by saagarjha 7y ago
The compiler will surely use a (most likely intrinsic) function with appropriate semantics in that case.
- tedunangst 7y agoThe release notes go on to say that you may need to provide your own implementation of bcmp, which does not sound very intrinsic.
- saagarjha 7y agoHuh, interesting. I was assuming that the compiler would statically link in a bcmp in that case, but it looks like it will literally replace it with a call to bcmp in certain cases (as defined by the remainder of that point in the release notes). Apparently this was brought up and brushed aside as not an issue: https://bugs.llvm.org/show_bug.cgi?id=41035 https://bugs.llvm.org/show_bug.cgi?id=41035
- Someone 7y agoYou may if you’re building freestanding code (code that doesn’t use the standard library), but do not specify that you are. I think that’s reasonable. I do wonder why this is a LLVM feature, though, and not a clang one. The system should only make this change if it came from a C(++) compiler and the source included the system header (<string.h> or <cstring>) to get memcmp. How can LLVM know that the symbol memcmp it sees came from that header, and not from user C code that may do something different, or even from, say, a Cobol compiler?