aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2asm.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2001-05-12 21:30:09 -0700
committerRichard Henderson <rth@gcc.gnu.org>2001-05-12 21:30:09 -0700
commitb627d6fe5d17bab51971acf505bb545cf31ff3a5 (patch)
tree9cb53ce676b1db0e40a14c11f71adb621954cbb0 /gcc/dwarf2asm.c
parent1f730ff7b674c4309a3684f9e7f901ccf01da9c7 (diff)
downloadgcc-b627d6fe5d17bab51971acf505bb545cf31ff3a5.zip
gcc-b627d6fe5d17bab51971acf505bb545cf31ff3a5.tar.gz
gcc-b627d6fe5d17bab51971acf505bb545cf31ff3a5.tar.bz2
dwarf2asm.c (size_of_encoded_value): New function.
* dwarf2asm.c (size_of_encoded_value): New function. * dwarf2asm.h: Declare it. * except.c (output_function_exception_table): Align the TType array only as wide as the encoding. From-SVN: r42028
Diffstat (limited to 'gcc/dwarf2asm.c')
-rw-r--r--gcc/dwarf2asm.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
index 104879e..a18607a 100644
--- a/gcc/dwarf2asm.c
+++ b/gcc/dwarf2asm.c
@@ -445,6 +445,31 @@ size_of_sleb128 (value)
return size;
}
+/* Given an encoding, return the number of bytes the format occupies.
+ This is only defined for fixed-size encodings, and so does not
+ include leb128. */
+
+int
+size_of_encoded_value (encoding)
+ int encoding;
+{
+ if (encoding == DW_EH_PE_omit)
+ return 0;
+
+ switch (encoding & 0x07)
+ {
+ case DW_EH_PE_absptr:
+ return POINTER_SIZE / BITS_PER_UNIT;
+ case DW_EH_PE_udata2:
+ return 2;
+ case DW_EH_PE_udata4:
+ return 4;
+ case DW_EH_PE_udata8:
+ return 8;
+ }
+ abort ();
+}
+
/* Output an unsigned LEB128 quantity. */
void