Skip to content

Commit

Permalink
Update __rust_{alloc,realloc} builtins
Browse files Browse the repository at this point in the history
The prototypes for these alloc functions changed in library/alloc and
need updating here.
  • Loading branch information
jacob-hughes committed Feb 2, 2021
1 parent 70d09f2 commit 55e9ff6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions llvm/lib/Analysis/TargetLibraryInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,10 +1491,9 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
}

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

case LibFunc_rust_dealloc:
return (NumParams == 3 && FTy.getReturnType()->isVoidTy() &&
Expand All @@ -1503,13 +1502,11 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
FTy.getParamType(2)->isIntegerTy());

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

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

0 comments on commit 55e9ff6

Please sign in to comment.