mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Recognize and verify the new GC intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13687 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
942ae1a07d
commit
e899705c27
@ -217,6 +217,11 @@ unsigned Function::getIntrinsicID() const {
|
||||
case 'f':
|
||||
if (getName() == "llvm.frameaddress") return Intrinsic::frameaddress;
|
||||
break;
|
||||
case 'g':
|
||||
if (getName() == "llvm.gcwrite") return Intrinsic::gcwrite;
|
||||
if (getName() == "llvm.gcread") return Intrinsic::gcread;
|
||||
if (getName() == "llvm.gcroot") return Intrinsic::gcroot;
|
||||
break;
|
||||
case 'l':
|
||||
if (getName() == "llvm.longjmp") return Intrinsic::longjmp;
|
||||
break;
|
||||
|
@ -653,15 +653,14 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
NumArgs = 1;
|
||||
break;
|
||||
|
||||
case Intrinsic:: readio: {
|
||||
const Type * ParamType = FT->getParamType(0);
|
||||
const Type * ReturnType = FT->getReturnType();
|
||||
case Intrinsic::readio: {
|
||||
const PointerType *ParamType = dyn_cast<PointerType>(FT->getParamType(0));
|
||||
const Type *ReturnType = FT->getReturnType();
|
||||
|
||||
Assert1(FT->getNumParams() == 1,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(isa<PointerType>(ParamType),
|
||||
"First argument not a pointer!", IF);
|
||||
Assert1(((cast<PointerType>(ParamType)->getElementType()) == ReturnType),
|
||||
Assert1(ParamType, "First argument not a pointer!", IF);
|
||||
Assert1(ParamType->getElementType() == ReturnType,
|
||||
"Pointer type doesn't match return type!", IF);
|
||||
NumArgs = 1;
|
||||
break;
|
||||
@ -672,6 +671,17 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
case Intrinsic::sigsetjmp: NumArgs = 2; break;
|
||||
case Intrinsic::siglongjmp: NumArgs = 2; break;
|
||||
|
||||
case Intrinsic::gcroot:
|
||||
Assert1(FT->getNumParams() == 2,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(isa<Constant>(CI.getOperand(2)) ||
|
||||
isa<GlobalValue>(CI.getOperand(2)),
|
||||
"Second argument to llvm.gcroot must be a constant!", &CI);
|
||||
NumArgs = 2;
|
||||
break;
|
||||
case Intrinsic::gcread: NumArgs = 1; break;
|
||||
case Intrinsic::gcwrite: NumArgs = 2; break;
|
||||
|
||||
case Intrinsic::dbg_stoppoint: NumArgs = 4; break;
|
||||
case Intrinsic::dbg_region_start:NumArgs = 1; break;
|
||||
case Intrinsic::dbg_region_end: NumArgs = 1; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user