[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Verifier.cpp

John Criswell criswell at cs.uiuc.edu
Thu Apr 8 15:29:01 PDT 2004


Changes in directory llvm/lib/VMCore:

Function.cpp updated: 1.66 -> 1.67
Verifier.cpp updated: 1.90 -> 1.91

---
Log message:

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.



---
Diffs of the changes:  (+23 -0)

Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.66 llvm/lib/VMCore/Function.cpp:1.67
--- llvm/lib/VMCore/Function.cpp:1.66	Fri Mar 12 18:24:00 2004
+++ llvm/lib/VMCore/Function.cpp	Thu Apr  8 15:27:38 2004
@@ -227,6 +227,7 @@
     break;
   case 'r':
     if (getName() == "llvm.returnaddress")  return Intrinsic::returnaddress;
+    if (getName() == "llvm.readport")       return Intrinsic::readport;
     break;
   case 's':
     if (getName() == "llvm.setjmp")     return Intrinsic::setjmp;
@@ -237,6 +238,8 @@
     if (getName() == "llvm.va_copy")  return Intrinsic::vacopy;
     if (getName() == "llvm.va_end")   return Intrinsic::vaend;
     if (getName() == "llvm.va_start") return Intrinsic::vastart;
+  case 'w':
+    if (getName() == "llvm.writeport") return Intrinsic::writeport;
     break;
   }
   // The "llvm." namespace is reserved!


Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.90 llvm/lib/VMCore/Verifier.cpp:1.91
--- llvm/lib/VMCore/Verifier.cpp:1.90	Fri Apr  2 09:45:08 2004
+++ llvm/lib/VMCore/Verifier.cpp	Thu Apr  8 15:27:38 2004
@@ -606,6 +606,26 @@
     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;





More information about the llvm-commits mailing list