diff options
author | John Criswell <criswell@uiuc.edu> | 2004-04-14 13:46:52 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2004-04-14 13:46:52 +0000 |
commit | 994a765e5cc28beae12e99fe2c680ad15c951cbd (patch) | |
tree | fe84fbfcb0be14648cde7f5612743dfe1bc5b2b9 | |
parent | d9955aaa61adbcb7118d4d090d00a4c6a7bbadf1 (diff) |
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
-rw-r--r-- | lib/VMCore/Function.cpp | 2 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 22 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index 332d598787..5b2b054330 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -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! diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index f40ffe0a13..fc237e69e5 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -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; |