[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun May 23 16:19:01 PDT 2004
Changes in directory llvm/lib/VMCore:
Function.cpp updated: 1.68 -> 1.69
Verifier.cpp updated: 1.99 -> 1.100
---
Log message:
Recognize and verify the new GC intrinsics.
---
Diffs of the changes: (+21 -6)
Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.68 llvm/lib/VMCore/Function.cpp:1.69
--- llvm/lib/VMCore/Function.cpp:1.68 Wed Apr 14 08:46:52 2004
+++ llvm/lib/VMCore/Function.cpp Sun May 23 16:16:51 2004
@@ -217,6 +217,11 @@
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;
Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.99 llvm/lib/VMCore/Verifier.cpp:1.100
--- llvm/lib/VMCore/Verifier.cpp:1.99 Fri May 21 11:47:21 2004
+++ llvm/lib/VMCore/Verifier.cpp Sun May 23 16:16:51 2004
@@ -653,15 +653,14 @@
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;
@@ -671,6 +670,17 @@
case Intrinsic::longjmp: NumArgs = 2; break;
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;
More information about the llvm-commits
mailing list