mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Finish adding the llvm.readio and llvm.writeio intrinsics.
Sorry these didn't get in yesterday. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12942 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d9955aaa61
commit
994a765e5c
@ -228,6 +228,7 @@ unsigned Function::getIntrinsicID() const {
|
||||
case 'r':
|
||||
if (getName() == "llvm.returnaddress") return Intrinsic::returnaddress;
|
||||
if (getName() == "llvm.readport") return Intrinsic::readport;
|
||||
if (getName() == "llvm.readio") return Intrinsic::readio;
|
||||
break;
|
||||
case 's':
|
||||
if (getName() == "llvm.setjmp") return Intrinsic::setjmp;
|
||||
@ -240,6 +241,7 @@ unsigned Function::getIntrinsicID() const {
|
||||
if (getName() == "llvm.va_start") return Intrinsic::vastart;
|
||||
case 'w':
|
||||
if (getName() == "llvm.writeport") return Intrinsic::writeport;
|
||||
if (getName() == "llvm.writeio") return Intrinsic::writeio;
|
||||
break;
|
||||
}
|
||||
// The "llvm." namespace is reserved!
|
||||
|
@ -618,14 +618,36 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
||||
NumArgs = 2;
|
||||
break;
|
||||
|
||||
case Intrinsic::writeio:
|
||||
Assert1(FT->getNumParams() == 2,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(FT->getParamType(0)->isFirstClassType(),
|
||||
"First argument not a first class type!", IF);
|
||||
Assert1(FT->getParamType(1)->getPrimitiveID() == Type::PointerTyID,
|
||||
"Second argument not a pointer!", IF);
|
||||
NumArgs = 2;
|
||||
break;
|
||||
|
||||
case Intrinsic::readport:
|
||||
Assert1(FT->getNumParams() == 1,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(FT->getReturnType()->isFirstClassType(),
|
||||
"Return type is not a first class type!", IF);
|
||||
Assert1(FT->getParamType(0)->isUnsigned(),
|
||||
"First argument not unsigned int!", IF);
|
||||
NumArgs = 1;
|
||||
break;
|
||||
|
||||
case Intrinsic:: readio:
|
||||
Assert1(FT->getNumParams() == 1,
|
||||
"Illegal # arguments for intrinsic function!", IF);
|
||||
Assert1(FT->getReturnType()->isFirstClassType(),
|
||||
"Return type is not a first class type!", IF);
|
||||
Assert1(FT->getParamType(0)->getPrimitiveID() == Type::PointerTyID,
|
||||
"First argument not a pointer!", IF);
|
||||
NumArgs = 1;
|
||||
break;
|
||||
|
||||
case Intrinsic::setjmp: NumArgs = 1; break;
|
||||
case Intrinsic::longjmp: NumArgs = 2; break;
|
||||
case Intrinsic::sigsetjmp: NumArgs = 2; break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user