[llvm-commits] [PATCH 2/5] Record a symbol's size which is needed for ELF symbol tables.

Eli Friedman eli.friedman at gmail.com
Mon Jul 26 13:52:56 PDT 2010


On Mon, Jul 26, 2010 at 1:00 PM, Matt Fleming <matt at console-pimps.org> wrote:
> ---
>  include/llvm/MC/MCAssembler.h |   22 ++++++++++++++++++++++
>  lib/MC/MCAssembler.cpp        |    3 ++-
>  2 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/include/llvm/MC/MCAssembler.h b/include/llvm/MC/MCAssembler.h
> index 51f265d..c189a1d 100644
> --- a/include/llvm/MC/MCAssembler.h
> +++ b/include/llvm/MC/MCAssembler.h
> @@ -24,6 +24,7 @@ namespace llvm {
>  class raw_ostream;
>  class MCAsmLayout;
>  class MCAssembler;
> +class MCBinaryExpr;
>  class MCContext;
>  class MCCodeEmitter;
>  class MCExpr;
> @@ -460,6 +461,10 @@ public:
>   // common symbol can never get a definition.
>   uint64_t CommonSize;
>
> +  uint64_t SymbolSize;
> +
> +  const MCBinaryExpr *SizeSymbol;
> +
>   /// CommonAlign - The alignment of the symbol, if it is 'common'.
>   //
>   // FIXME: Pack this in with other fields?
> @@ -517,6 +522,23 @@ public:
>     return CommonSize;
>   }
>
> +  void setSize(uint64_t _SymbolSize) {
> +    SymbolSize = _SymbolSize;
> +  }
> +
> +  uint64_t getSize() {
> +    return SymbolSize;
> +  }
> +
> +  void setSizeSymbol(const MCBinaryExpr *SS) {
> +    SizeSymbol = SS;
> +  }
> +
> +  const MCBinaryExpr *getSizeSymbol() {
> +    return SizeSymbol;
> +  }

Why not just "const MCExpr *getSize()"?

On a side note, I don't really follow the distinction between MCSymbol
and MCSymbolData...

-Eli




More information about the llvm-commits mailing list