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

Devang Patel dpatel at apple.com
Mon Jan 5 13:40:10 PST 2009


On Jan 5, 2009, at 1:24 PM, Evan Cheng wrote:

>> =
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Mon Jan  5
>> 11:57:47 2009
>> @@ -23,6 +23,7 @@
>> #include "llvm/CodeGen/MachineModuleInfo.h"
>> #include "llvm/CodeGen/MachineFrameInfo.h"
>> #include "llvm/CodeGen/MachineLocation.h"
>> +#include "llvm/Analysis/DebugInfo.h"
>> #include "llvm/Support/Debug.h"
>> #include "llvm/Support/Dwarf.h"
>> #include "llvm/Support/CommandLine.h"
>> @@ -1496,6 +1497,49 @@
>>    }
>>  }
>>
>> +  /// ConstructType - Construct basic type die from DIBasicType.
>> +  void ConstructType(CompileUnit *DW_Unit, DIE &Buffer,
>> +                     DIBasicType *BTy) {
>> +
>> +    // Get core information.
>> +    const std::string &Name = BTy->getName();
>
> This makes a copy of the name string. Is it possible to change
> AddString, DIEString, etc. to take const char* instead? Then you can
> use getNameStart() instead.


AddString and DIEString takes std::string reference. However,  
DebugInfo::getName() extracts string value from GV on demand where  
there is a possibility to cache extracted strings.
-
Devang






More information about the llvm-commits mailing list