[PATCH] D70143: Check result of emitStrLen before passing it to CreateGEP

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 17:40:21 PST 2019


jdoerfert added a comment.

One style comment, patch looks conceptually fine to me otherwise. I'll wait to accept on how we fall on the test issue: I'd opt for an `opt` test if possible.



================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:370
+                    : nullptr;
+    }
     return nullptr;
----------------
Consistent style please:

```
if (Value *StrLen = emitStrLen(SrcStr, B, DL, TLI)
  return B.CreateGEP(B.getInt8Ty(), SrcStr, StrLen, "strchr");
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70143/new/

https://reviews.llvm.org/D70143





More information about the cfe-commits mailing list