mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-11 06:06:52 +00:00
Allow llvm.gcroot to work with non-pointer allocas.
llvm-svn: 115198
This commit is contained in:
parent
5aae0d6863
commit
ee60bd194c
@ -1645,10 +1645,14 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
if (ID == Intrinsic::gcroot) {
|
||||
AllocaInst *AI =
|
||||
dyn_cast<AllocaInst>(CI.getArgOperand(0)->stripPointerCasts());
|
||||
Assert1(AI && AI->getType()->getElementType()->isPointerTy(),
|
||||
"llvm.gcroot parameter #1 must be a pointer alloca.", &CI);
|
||||
Assert1(AI, "llvm.gcroot parameter #1 must be an alloca.", &CI);
|
||||
Assert1(isa<Constant>(CI.getArgOperand(1)),
|
||||
"llvm.gcroot parameter #2 must be a constant.", &CI);
|
||||
if (!AI->getType()->getElementType()->isPointerTy()) {
|
||||
Assert1(!isa<ConstantPointerNull>(CI.getArgOperand(1)),
|
||||
"llvm.gcroot parameter #1 must either be a pointer alloca, "
|
||||
"or argument #2 must be a non-null constant.", &CI);
|
||||
}
|
||||
}
|
||||
|
||||
Assert1(CI.getParent()->getParent()->hasGC(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user