Add support for setjmp/longjmp primitives

Patch checked in for Bill Wendling :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-05-17 22:26:33 +00:00
parent 9b11f48711
commit c436b37262
5 changed files with 44 additions and 16 deletions
+9 -13
View File
@@ -164,20 +164,16 @@ unsigned Function::getIntrinsicID() const {
return 0; // All intrinsics start with 'llvm.'
switch (getName()[5]) {
case 'l':
if (getName() == "llvm.longjmp") return LLVMIntrinsic::longjmp;
break;
case 's':
if (getName() == "llvm.setjmp") return LLVMIntrinsic::setjmp;
break;
case 'v':
if (getName().size() >= 9) {
switch (getName()[8]) {
case 's':
if (getName() == "llvm.va_start") return LLVMIntrinsic::va_start;
break;
case 'e':
if (getName() == "llvm.va_end") return LLVMIntrinsic::va_end;
break;
case 'c':
if (getName() == "llvm.va_copy") return LLVMIntrinsic::va_copy;
break;
}
}
if (getName() == "llvm.va_copy") return LLVMIntrinsic::va_copy;
if (getName() == "llvm.va_end") return LLVMIntrinsic::va_end;
if (getName() == "llvm.va_start") return LLVMIntrinsic::va_start;
break;
}
// The "llvm." namespace is reserved!