forked from OSchip/llvm-project
[TargetLibraryInfo] Reduce code duplication.
llvm-svn: 273241
This commit is contained in:
parent
0a0fb0fda1
commit
9cc0bca23c
|
@ -596,7 +596,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
|
|||
case LibFunc::strtok_r:
|
||||
return (NumParams >= 2 && FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::scanf:
|
||||
return (NumParams >= 1 && FTy.getParamType(0)->isPointerTy());
|
||||
case LibFunc::setbuf:
|
||||
case LibFunc::setvbuf:
|
||||
return (NumParams >= 1 && FTy.getParamType(0)->isPointerTy());
|
||||
|
@ -604,13 +603,9 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
|
|||
case LibFunc::strndup:
|
||||
return (NumParams >= 1 && FTy.getReturnType()->isPointerTy() &&
|
||||
FTy.getParamType(0)->isPointerTy());
|
||||
case LibFunc::sscanf:
|
||||
case LibFunc::stat:
|
||||
case LibFunc::statvfs:
|
||||
return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
|
||||
FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::sscanf:
|
||||
return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
|
||||
FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::sprintf:
|
||||
return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
|
||||
FTy.getParamType(1)->isPointerTy());
|
||||
|
@ -674,7 +669,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
|
|||
case LibFunc::read:
|
||||
return (NumParams == 3 && FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::rewind:
|
||||
return (NumParams >= 1 && FTy.getParamType(0)->isPointerTy());
|
||||
case LibFunc::rmdir:
|
||||
case LibFunc::remove:
|
||||
case LibFunc::realpath:
|
||||
|
@ -688,8 +682,6 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
|
|||
case LibFunc::write:
|
||||
return (NumParams == 3 && FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::bcopy:
|
||||
return (NumParams == 3 && FTy.getParamType(0)->isPointerTy() &&
|
||||
FTy.getParamType(1)->isPointerTy());
|
||||
case LibFunc::bcmp:
|
||||
return (NumParams == 3 && FTy.getParamType(0)->isPointerTy() &&
|
||||
FTy.getParamType(1)->isPointerTy());
|
||||
|
|
Loading…
Reference in New Issue