Remove std::string uses from DebugInfo interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83083 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-09-29 18:40:58 +00:00
parent 1e9a727f10
commit 5ccdd10b1a
8 changed files with 141 additions and 222 deletions

View File

@@ -44,8 +44,7 @@ void PIC16DbgInfo::PopulateDebugInfo (DIType Ty, unsigned short &TypeNo,
/// PopulateBasicTypeInfo- Populate TypeNo for basic type from Ty.
///
void PIC16DbgInfo::PopulateBasicTypeInfo (DIType Ty, unsigned short &TypeNo) {
std::string Name = "";
Ty.getName(Name);
std::string Name = Ty.getName();
unsigned short BaseTy = GetTypeDebugNumber(Name);
TypeNo = TypeNo << PIC16Dbg::S_BASIC;
TypeNo = TypeNo | (0xffff & BaseTy);
@@ -117,7 +116,7 @@ void PIC16DbgInfo::PopulateStructOrUnionTypeInfo (DIType Ty,
TypeNo = TypeNo | PIC16Dbg::T_STRUCT;
else
TypeNo = TypeNo | PIC16Dbg::T_UNION;
CTy.getName(TagName);
TagName = CTy.getName();
// UniqueSuffix is .number where number is obtained from
// llvm.dbg.composite<number>.
// FIXME: This will break when composite type is not represented by
@@ -305,9 +304,8 @@ void PIC16DbgInfo::EmitCompositeTypeElements (DICompositeType CTy,
bool HasAux = false;
int ElementAux[PIC16Dbg::AuxSize] = { 0 };
std::string TagName = "";
std::string ElementName;
DIDerivedType DITy(Element.getNode());
DITy.getName(ElementName);
const char *ElementName = DITy.getName();
unsigned short ElementSize = DITy.getSizeInBits()/8;
// Get mangleddd name for this structure/union element.
std::string MangMemName = ElementName + SuffixNo;
@@ -338,8 +336,7 @@ void PIC16DbgInfo::EmitCompositeTypeDecls(Module &M) {
continue;
if (CTy.getTag() == dwarf::DW_TAG_union_type ||
CTy.getTag() == dwarf::DW_TAG_structure_type ) {
std::string Name;
CTy.getName(Name);
const char *Name = CTy.getName();
// Get the number after llvm.dbg.composite and make UniqueSuffix from
// it.
std::string DIVar = CTy.getNode()->getNameStr();
@@ -468,9 +465,9 @@ void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
void PIC16DbgInfo::SwitchToCU(MDNode *CU) {
// Get the file path from CU.
DICompileUnit cu(CU);
std::string DirName, FileName;
std::string FilePath = cu.getDirectory(DirName) + "/" +
cu.getFilename(FileName);
std::string DirName = cu.getDirectory();
std::string FileName = cu.getFilename();
std::string FilePath = DirName + "/" + FileName;
// Nothing to do if source file is still same.
if ( FilePath == CurFile ) return;