mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[TargetLibraryInfo] Reduce code duplication.
llvm-svn: 273241
This commit is contained in:
parent
f599cc3620
commit
9926477167
@ -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…
x
Reference in New Issue
Block a user