diff options
author | John Criswell <criswell@uiuc.edu> | 2004-04-08 20:27:38 +0000 |
---|---|---|
committer | John Criswell <criswell@uiuc.edu> | 2004-04-08 20:27:38 +0000 |
commit | 9570301ee8e473c4e6df3eb71b82b79a6072891a (patch) | |
tree | b4c7c83530870b919e1a97d9980128e423f20f91 /lib/VMCore/Verifier.cpp | |
parent | 60a505b1f63668683da1288848dbb3c4a9c26ec1 (diff) | |
download | external_llvm-9570301ee8e473c4e6df3eb71b82b79a6072891a.zip external_llvm-9570301ee8e473c4e6df3eb71b82b79a6072891a.tar.gz external_llvm-9570301ee8e473c4e6df3eb71b82b79a6072891a.tar.bz2 |
Added the llvm.readport and llvm.writeport intrinsics.
The Verifier ensures that their parameters are of integral types and have
the correct sign, but it does not enforce any size restrictions because
such restrictions are platform dependent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Verifier.cpp')
-rw-r--r-- | lib/VMCore/Verifier.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 30b37ff..73192eb 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -606,6 +606,26 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { NumArgs = 1; break; + // Verify that read and write port have integral parameters of the correct + // signed-ness. + case Intrinsic::writeport: + Assert1(FT->getNumParams() == 2, + "Illegal # arguments for intrinsic function!", IF); + Assert1(FT->getParamType(0)->isUnsigned(), + "First argument not unsigned int!", IF); + Assert1(FT->getParamType(1)->isIntegral(), + "First argument not unsigned int!", IF); + NumArgs = 2; + break; + + case Intrinsic::readport: + Assert1(FT->getNumParams() == 1, + "Illegal # arguments for intrinsic function!", IF); + Assert1(FT->getParamType(0)->isUnsigned(), + "First argument not unsigned int!", IF); + NumArgs = 1; + break; + case Intrinsic::setjmp: NumArgs = 1; break; case Intrinsic::longjmp: NumArgs = 2; break; case Intrinsic::sigsetjmp: NumArgs = 2; break; |