Skip to content

Commit

Permalink
Remove type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-hughes committed Feb 9, 2021
1 parent 55e9ff6 commit 40d6804
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions llvm/lib/Analysis/TargetLibraryInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,22 +1491,9 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
}

case LibFunc_rust_alloc:
return (NumParams == 2 && FTy.getReturnType()->isPointerTy() &&
FTy.getParamType(0)->isIntegerTy() &&
FTy.getParamType(1)->isIntegerTy());

case LibFunc_rust_dealloc:
return (NumParams == 3 && FTy.getReturnType()->isVoidTy() &&
FTy.getParamType(0)->isPointerTy() &&
FTy.getParamType(1)->isIntegerTy() &&
FTy.getParamType(2)->isIntegerTy());

case LibFunc_rust_realloc:
return (NumParams == 4 && FTy.getReturnType()->isPointerTy() &&
FTy.getParamType(0)->isPointerTy() &&
FTy.getParamType(1)->isIntegerTy() &&
FTy.getParamType(2)->isIntegerTy() &&
FTy.getParamType(3)->isIntegerTy());
return true;

case LibFunc::NumLibFuncs:
case LibFunc::NotLibFunc:
Expand Down

0 comments on commit 40d6804

Please sign in to comment.