[llvm-commits] [llvm-gcc-4.2] r57861 - /llvm-gcc-4.2/trunk/gcc/except.c

Dan Gohman gohman at apple.com
Mon Oct 20 16:45:28 PDT 2008


Author: djg
Date: Mon Oct 20 18:45:28 2008
New Revision: 57861

URL: http://llvm.org/viewvc/llvm-project?rev=57861&view=rev
Log:
Re-apply r57527, with some cleanups from Duncan, now that
r57860 is in, which fixed the PCH problem that r57527
uncovered.

Modified:
    llvm-gcc-4.2/trunk/gcc/except.c

Modified: llvm-gcc-4.2/trunk/gcc/except.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/except.c?rev=57861&r1=57860&r2=57861&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/except.c (original)
+++ llvm-gcc-4.2/trunk/gcc/except.c Mon Oct 20 18:45:28 2008
@@ -4079,13 +4079,24 @@
   /* The default c++ routines aren't actually c++ specific, so use those.  */
   /* LLVM LOCAL begin */
 #ifdef ENABLE_LLVM
-  llvm_unwind_resume_libfunc = llvm_init_one_libfunc ( USING_SJLJ_EXCEPTIONS ?
-                                               "_Unwind_SjLj_Resume"
+  /* Create the decl with build_decl instead of using llvm_init_one_libfunc
+     so that we can specify an argument type instead of just using '...'.
+     '...' is functionally correct, but more work for codegen to handle,
+     and even requires additional instructions on some targets. */
+  const char *name = USING_SJLJ_EXCEPTIONS ?
+                       "_Unwind_SjLj_Resume"
 #ifdef LLVM_STACKSENSITIVE_UNWIND_RESUME
-                                               : "_Unwind_Resume_or_Rethrow");
+                       : "_Unwind_Resume_or_Rethrow";
 #else
-                                               : "_Unwind_Resume");
+                       : "_Unwind_Resume";
 #endif
+  tree decl = build_decl (FUNCTION_DECL, get_identifier (name),
+                          build_function_type_list (void_type_node,
+                                                    ptr_type_node, NULL_TREE));
+  DECL_ARTIFICIAL (decl) = 1;
+  DECL_EXTERNAL (decl) = 1;
+  TREE_PUBLIC (decl) = 1;
+  llvm_unwind_resume_libfunc = decl;
 #else
   unwind_resume_libfunc =
     init_one_libfunc ( USING_SJLJ_EXCEPTIONS ? "_Unwind_SjLj_Resume"





More information about the llvm-commits mailing list