[llvm-commits] [llvm] r61908 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp

Devang Patel dpatel at apple.com
Thu Jan 8 13:48:53 PST 2009


On Jan 8, 2009, at 1:38 PM, Evan Cheng wrote:

>> ----------------------------------------------------------------------=
>> ==//
>> +/// DbgScope - This class is used to track scope information.
>> +///
>> +class DbgScope {
>> +private:
>> +  DbgScope *Parent;                   // Parent to this scope.
>> +  DIDescriptor *Desc;                 // Debug info descriptor for
>> scope.
>> +                                      // Either subprogram or block.
>> +  unsigned StartLabelID;              // Label ID of the beginning
>> of scope.
>> +  unsigned EndLabelID;                // Label ID of the end of
>> scope.
>> +  SmallVector<DbgScope *, 8> Scopes;     // Scopes defined in scope.
>> +  SmallVector<DbgVariable *, 32> Variables;// Variables declared in
>> scope.
>
> 32 seems a bit excessive, no?

probably. I'll make it 16 for now until we have measurement numbers.

> Evan
>
>>
>> +
>> +public:
>> +  DbgScope(DbgScope *P, DIDescriptor *D)
>> +  : Parent(P), Desc(D), StartLabelID(0), EndLabelID(0), Scopes(),
>> Variables()
>> +  {}
>> +  ~DbgScope();
>> +
>> +  // Accessors.
>> +  DbgScope *getParent()        const { return Parent; }
>> +  DIDescriptor *getDesc()       const { return Desc; }
>> +  unsigned getStartLabelID()     const { return StartLabelID; }
>> +  unsigned getEndLabelID()       const { return EndLabelID; }
>> +  SmallVector<DbgScope *, 8> &getScopes() { return Scopes; }
>> +  SmallVector<DbgVariable *, 32> &getVariables() { return
>> Variables; }
>
> Return SmallVectorImpl instead?

good idea!
>
>
>
> Evan
>
>

-
Devang






More information about the llvm-commits mailing list