mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-06 18:46:18 +00:00
Mark str[r]chr readonly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98663 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b85c7100c5
commit
4446b04052
@ -1400,6 +1400,15 @@ bool SimplifyLibCalls::doInitialization(Module &M) {
|
||||
setOnlyReadsMemory(F);
|
||||
setDoesNotThrow(F);
|
||||
setDoesNotCapture(F, 1);
|
||||
} else if (Name == "strchr" ||
|
||||
Name == "strrchr") {
|
||||
if (FTy->getNumParams() != 2 ||
|
||||
!FTy->getParamType(0)->isPointerTy() ||
|
||||
!FTy->getParamType(1)->isIntegerTy())
|
||||
continue;
|
||||
setOnlyReadsMemory(F);
|
||||
setDoesNotThrow(F);
|
||||
setDoesNotCapture(F, 1);
|
||||
} else if (Name == "strcpy" ||
|
||||
Name == "stpcpy" ||
|
||||
Name == "strcat" ||
|
||||
@ -1428,7 +1437,7 @@ bool SimplifyLibCalls::doInitialization(Module &M) {
|
||||
} else if (Name == "strcmp" ||
|
||||
Name == "strspn" ||
|
||||
Name == "strncmp" ||
|
||||
Name ==" strcspn" ||
|
||||
Name == "strcspn" ||
|
||||
Name == "strcoll" ||
|
||||
Name == "strcasecmp" ||
|
||||
Name == "strncasecmp") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user