This patch adds an inlined fast path for the common case of a single-byte LEB128 number. This provides significant speed-ups for DWARF processing (mostly for the as-yet-unsubmitted changes to generate the .gdb-index section). In my testing, read_unsigned_LEB_128() accounted for more than 5% of the link time when generating a gdb index; with this change, the LEB128 routines are negligible, resulting in a 5% improvement. This should also improve line number lookup and ODR detection. I've also added new unit tests for the LEB128 readers. Tested on x86_64. OK? -cary 2012-01-24 Cary Coutant * int_encoding.cc (read_unsigned_LEB_128): Replaced with inline definition and ... (read_unsigned_LEB_128_x): ... this new function. (read_signed_LEB_128): Replaced with inline definition and ... (read_signed_LEB_128_x): ... this new function. * int_encoding.h (read_unsigned_LEB_128_x): New function. (read_unsigned_LEB_128): Add inline definition. (read_signed_LEB_128_x): New function. (read_signed_LEB_128): Add inline definition. * testsuite/Makefile.am (leb128_unittest): New unit test. * testsuite/Makefile.in: Regenerate. * testsuite/leb128_unittest.cc: New unit test.