Skip to content

Commit 55e9ff6

Browse files
committed
Update __rust_{alloc,realloc} builtins
The prototypes for these alloc functions changed in library/alloc and need updating here.
1 parent 70d09f2 commit 55e9ff6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

llvm/lib/Analysis/TargetLibraryInfo.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,10 +1491,9 @@ bool TargetLibraryInfoImpl::isValidProtoForLibFunc(const FunctionType &FTy,
14911491
}
14921492

14931493
case LibFunc_rust_alloc:
1494-
return (NumParams == 3 && FTy.getReturnType()->isPointerTy() &&
1494+
return (NumParams == 2 && FTy.getReturnType()->isPointerTy() &&
14951495
FTy.getParamType(0)->isIntegerTy() &&
1496-
FTy.getParamType(1)->isIntegerTy() &&
1497-
FTy.getParamType(2)->isPointerTy());
1496+
FTy.getParamType(1)->isIntegerTy());
14981497

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

15051504
case LibFunc_rust_realloc:
1506-
return (NumParams == 6 && FTy.getReturnType()->isPointerTy() &&
1505+
return (NumParams == 4 && FTy.getReturnType()->isPointerTy() &&
15071506
FTy.getParamType(0)->isPointerTy() &&
15081507
FTy.getParamType(1)->isIntegerTy() &&
15091508
FTy.getParamType(2)->isIntegerTy() &&
1510-
FTy.getParamType(3)->isIntegerTy() &&
1511-
FTy.getParamType(4)->isIntegerTy() &&
1512-
FTy.getParamType(5)->isPointerTy());
1509+
FTy.getParamType(3)->isIntegerTy());
15131510

15141511
case LibFunc::NumLibFuncs:
15151512
case LibFunc::NotLibFunc:

0 commit comments

Comments
 (0)