[llvm-commits] [PATCH 2/5] Record a symbol's size which is needed for ELF symbol tables.
Daniel Dunbar
daniel at zuster.org
Mon Aug 2 21:53:26 PDT 2010
On Mon, Jul 26, 2010 at 1:52 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> 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...
MCSymbol is shared with CodeGen, MCSymbolData is something private to
the assembler backend and only used when writing .o files.
That said, I would like to eliminate the split eventually...
- Daniel
> -Eli
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list