[PATCH] D18230: [SimplifyLibCalls] Simplify strlen to a subtraction for certain cases
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 12 09:45:54 PDT 2016
spatel added inline comments.
================
Comment at: include/llvm/Analysis/ValueTracking.h:185-186
@@ -183,1 +184,4 @@
+ // isGEPBasedOnPointerToString - Returns true if the GEP is based on a pointer
+ // to a string (array of i8), and is indexing into this string.
+ bool isGEPBasedOnPointerToString(const GEPOperator *GEP);
----------------
Doxygen comments start with 3 slashes ('///'). Also, don't repeat the function name in the comment:
http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments
Feel free to fix the rest of the file in a separate commit. :)
================
Comment at: lib/Analysis/ValueTracking.cpp:2654-2655
@@ -2653,1 +2653,4 @@
+// This function checks if the GEP is based on a pointer to a string and is
+// indexing into the string.
+bool llvm::isGEPBasedOnPointerToString(const GEPOperator *GEP) {
----------------
Don't repeat the block comment from the header file.
================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:551-552
@@ +550,4 @@
+ StringRef Str;
+ size_t ArrSize =
+ cast<ArrayType>(GEP->getSourceElementType())->getNumElements();
+ if (getConstantStringInfo(GEP->getOperand(0), Str, 0, false)) {
----------------
You can move this down to where it is actually used.
http://reviews.llvm.org/D18230
More information about the llvm-commits
mailing list