diff gen/runtime.cpp @ 314:8d98e42ece93 trunk

[svn r335] The basics of exception handling are in place. Still need to make sure calls are turned into invokes everywhere. (NewExpression for instance) Still some rough edges and corner cases to figure out. Needs testing!
author ChristianK
date Wed, 02 Jul 2008 22:20:18 +0200
parents d59c363fccad
children 385a18242485
line wrap: on
line diff
--- a/gen/runtime.cpp	Sun Jun 29 22:22:37 2008 +0200
+++ b/gen/runtime.cpp	Wed Jul 02 22:20:18 2008 +0200
@@ -880,4 +880,30 @@
         llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
         llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname2, M);
     }
+
+    /////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////////////////
+
+    // int _d_eh_personality(int ver, int actions, ulong eh_class, ptr eh_info, ptr context)
+    {
+        std::string fname("_d_eh_personality");
+        std::vector<const LLType*> types;
+        types.push_back(intTy);
+        types.push_back(intTy);
+        types.push_back(longTy);
+        types.push_back(voidPtrTy);
+        types.push_back(voidPtrTy);
+        const llvm::FunctionType* fty = llvm::FunctionType::get(intTy, types, false);
+        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
+    }
+
+    // void _d_eh_resume_unwind(ptr exc_struct)
+    {
+        std::string fname("_d_eh_resume_unwind");
+        std::vector<const LLType*> types;
+        types.push_back(voidPtrTy);
+        const llvm::FunctionType* fty = llvm::FunctionType::get(voidTy, types, false);
+        llvm::Function::Create(fty, llvm::GlobalValue::ExternalLinkage, fname, M);
+    }
 }