diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-13 18:57:31 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-13 18:57:31 +0000 |
commit | 382597e4e1587e7de04f81ba9903811a8a93d640 (patch) | |
tree | 3c1d073f5371ed3d1591b0a5f61b529b6c5b86af /gcc/expr.c | |
parent | dc9e4762207f5086d6dabe37bea7c45119a85ea4 (diff) | |
download | gcc-382597e4e1587e7de04f81ba9903811a8a93d640.tar.gz |
Centralize knowledge of eh personality routines.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165433 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index b0c160f9367..0050518d8c8 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -10255,13 +10255,31 @@ const_vector_from_tree (tree exp) return gen_rtx_CONST_VECTOR (mode, v); } - -/* Build a decl for a EH personality function named NAME. */ +/* Build a decl for a personality function given a language prefix. */ tree -build_personality_function (const char *name) +build_personality_function (const char *lang) { + const char *unwind_and_version; tree decl, type; + char *name; + + switch (targetm.except_unwind_info ()) + { + case UI_NONE: + return NULL; + case UI_SJLJ: + unwind_and_version = "_sj0"; + break; + case UI_DWARF2: + case UI_TARGET: + unwind_and_version = "_v0"; + break; + default: + gcc_unreachable (); + } + + name = ACONCAT (("__", lang, "_personality", unwind_and_version, NULL)); type = build_function_type_list (integer_type_node, integer_type_node, long_long_unsigned_type_node, |