diff options
author | Richard Henderson <rth@redhat.com> | 2001-05-12 21:30:09 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-05-12 21:30:09 -0700 |
commit | b627d6fe5d17bab51971acf505bb545cf31ff3a5 (patch) | |
tree | 9cb53ce676b1db0e40a14c11f71adb621954cbb0 /gcc/dwarf2asm.c | |
parent | 1f730ff7b674c4309a3684f9e7f901ccf01da9c7 (diff) | |
download | gcc-b627d6fe5d17bab51971acf505bb545cf31ff3a5.tar.gz |
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 104879e4660..a18607aaf82 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 |