[llvm-commits] [llvm] r97078 - in /llvm/trunk/lib/CodeGen/AsmPrinter: DwarfException.cpp DwarfPrinter.cpp DwarfPrinter.h

Chris Lattner clattner at apple.com
Wed Feb 24 16:09:26 PST 2010


On Feb 24, 2010, at 3:34 PM, Bill Wendling wrote:
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=97078&view=rev
> Log:
> LLVM puts padding bytes in the __gcc_except_tab section after the
> GCC_except_table label but before the Lexception, which the FDE references.
> This causes problems as the FDE does not point to the start of an LSDA chunk.
> 
> Use an unnormalized uleb128 for the call-site table length that includes the
> padding.

Ok, I don't really understand, but:

> 
> -  // If we don't have .uleb128, emit as .bytes.
> +  // If we don't have .uleb128 or we want to emit padding, emit as .bytes.
>   do {
>     unsigned char Byte = static_cast<unsigned char>(Value & 0x7f);
>     Value >>= 7;
> -    if (Value) Byte |= 0x80;
> +    if (Value || PadTo != 0) Byte |= 0x80;
>     Asm->OutStreamer.EmitIntValue(Byte, 1, /*addrspace*/0);
>   } while (Value);
> +
> +  if (PadTo)
> +    while (PadTo--) {
> +      unsigned char Byte = (PadTo ? 0x80 : 0x00);
> +      if (Asm->VerboseAsm)
> +        Asm->OutStreamer.AddComment("Padding");
> +      Asm->OutStreamer.EmitIntValue(Byte, 1, /*addrspace*/0);
> +    }

Please use OutStreamer.EmitFill instead of a loop for stuff like this.  Thanks for mc'izing!

-Chris



More information about the llvm-commits mailing list