Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update __rust_{alloc,realloc} builtins
The prototypes for these alloc functions changed in library/alloc and
need updating here.
  • Loading branch information
jacob-hughes committed Feb 2, 2021
commit 55e9ff6ac714c307368216620a6955cc9582f088
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