diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-13 04:30:09 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-05-13 04:30:09 +0000 |
commit | 631413ffb804e5fbb59eef98fbfdddfd91e85629 (patch) | |
tree | 9cb53ce676b1db0e40a14c11f71adb621954cbb0 /gcc/dwarf2asm.c | |
parent | 6df8a9dd552113f43274ba4bf09830d2525ff4e9 (diff) | |
download | gcc-631413ffb804e5fbb59eef98fbfdddfd91e85629.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42028 138bc75d-0d04-0410-961f-82ee72b054a4
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 |