[llvm-commits] CVS: llvm/lib/VMCore/Function.cpp Verifier.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Aug 24 00:31:02 PDT 2003
Changes in directory llvm/lib/VMCore:
Function.cpp updated: 1.42 -> 1.43
Verifier.cpp updated: 1.55 -> 1.56
---
Log message:
Initial support for recognizing LLVM exception handling intrinsics
---
Diffs of the changes:
Index: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.42 llvm/lib/VMCore/Function.cpp:1.43
--- llvm/lib/VMCore/Function.cpp:1.42 Mon Aug 18 10:41:24 2003
+++ llvm/lib/VMCore/Function.cpp Sun Aug 24 00:30:29 2003
@@ -189,10 +189,16 @@
switch (getName()[5]) {
case 'a':
- for (unsigned i = 0; i < num_alpha_intrinsics; ++i) {
- if (getName() == alpha_intrinsics[i].name)
- return alpha_intrinsics[i].id;
- }
+ if (getName().size() > 11 &&
+ std::string(getName().begin()+4, getName().begin()+11) == ".alpha.")
+ for (unsigned i = 0; i < num_alpha_intrinsics; ++i)
+ if (getName() == alpha_intrinsics[i].name)
+ return alpha_intrinsics[i].id;
+ break;
+ case 'e':
+ if (getName() == "llvm.exc.getcurrent")return LLVMIntrinsic::exc_getcurrent;
+ if (getName() == "llvm.exc.rethrow") return LLVMIntrinsic::exc_getcurrent;
+ if (getName() == "llvm.exc.throw") return LLVMIntrinsic::exc_getcurrent;
break;
case 'l':
if (getName() == "llvm.longjmp") return LLVMIntrinsic::longjmp;
Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.55 llvm/lib/VMCore/Verifier.cpp:1.56
--- llvm/lib/VMCore/Verifier.cpp:1.55 Mon Aug 18 10:41:24 2003
+++ llvm/lib/VMCore/Verifier.cpp Sun Aug 24 00:30:29 2003
@@ -510,6 +510,8 @@
Assert1(IF->isExternal(), "Intrinsic functions should never be defined!", IF);
unsigned NumArgs = 0;
+ // FIXME: this should check the return type of each intrinsic as well, also
+ // arguments!
switch (ID) {
case LLVMIntrinsic::va_start:
Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
@@ -519,6 +521,11 @@
break;
case LLVMIntrinsic::va_end: NumArgs = 1; break;
case LLVMIntrinsic::va_copy: NumArgs = 2; break;
+
+ case LLVMIntrinsic::exc_throw: NumArgs = 1; break;
+ case LLVMIntrinsic::exc_rethrow: NumArgs = 0; break;
+ case LLVMIntrinsic::exc_getcurrent: NumArgs = 0; break;
+
case LLVMIntrinsic::setjmp: NumArgs = 1; break;
case LLVMIntrinsic::longjmp: NumArgs = 2; break;
case LLVMIntrinsic::sigsetjmp: NumArgs = 2; break;
More information about the llvm-commits
mailing list