[PATCH] D65019: [ARM] push LR before __gnu_mcount_nc on ARM
Jian Cai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 6 17:38:54 PDT 2019
jcai19 marked 4 inline comments as done.
jcai19 added inline comments.
================
Comment at: llvm/lib/Target/ARM/ARMFastISel.cpp:2418
+ bool PushLR = IntrinsicName &&
+ !memcmp(IntrinsicName, "\01__gnu_mcount_nc", sizeof("\01__gnu_mcount_nc"));
+ unsigned CallOpc = ARMSelectCallOp(UseReg, PushLR);
----------------
nickdesaulniers wrote:
> `memcmp` is a code smell in a C++ codebase, but I see that `IntrinsicName` is a C style string. Is there a reason why `strncmp` isn't used?
Good catch! I was thinking about one of str* functions and somehow ended up using memcpy. Guess I haven't written C code for a while :). Anyway, maybe strcmp is better here as the size of the two strings should match too?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65019/new/
https://reviews.llvm.org/D65019
More information about the cfe-commits
mailing list