Use overloaded operators instead of DIDescriptor::getNode()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103276 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2010-05-07 18:19:32 +00:00
parent 2db49d797b
commit ed66bf5125
5 changed files with 11 additions and 11 deletions

View File

@ -271,7 +271,7 @@ void DIDerivedType::replaceAllUsesWith(DIDescriptor &D) {
// which, due to uniquing, has merged with the source. We shield clients from // which, due to uniquing, has merged with the source. We shield clients from
// this detail by allowing a value to be replaced with replaceAllUsesWith() // this detail by allowing a value to be replaced with replaceAllUsesWith()
// itself. // itself.
if (getNode() != D) { if (DbgNode != D) {
MDNode *Node = DbgNode; MDNode *Node = DbgNode;
Node->replaceAllUsesWith(D); Node->replaceAllUsesWith(D);
Node->destroy(); Node->destroy();

View File

@ -70,7 +70,7 @@ void PIC16DbgInfo::PopulateDerivedTypeInfo (DIType Ty, unsigned short &TypeNo,
// We also need to encode the information about the base type of // We also need to encode the information about the base type of
// pointer in TypeNo. // pointer in TypeNo.
DIType BaseType = DIDerivedType(Ty.getNode()).getTypeDerivedFrom(); DIType BaseType = DIDerivedType(Ty).getTypeDerivedFrom();
PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName); PopulateDebugInfo(BaseType, TypeNo, HasAux, Aux, TagName);
} }
@ -79,7 +79,7 @@ void PIC16DbgInfo::PopulateArrayTypeInfo (DIType Ty, unsigned short &TypeNo,
bool &HasAux, int Aux[], bool &HasAux, int Aux[],
std::string &TagName) { std::string &TagName) {
DICompositeType CTy = DICompositeType(Ty.getNode()); DICompositeType CTy = DICompositeType(Ty);
DIArray Elements = CTy.getTypeArray(); DIArray Elements = CTy.getTypeArray();
unsigned short size = 1; unsigned short size = 1;
unsigned short Dimension[4]={0,0,0,0}; unsigned short Dimension[4]={0,0,0,0};
@ -88,7 +88,7 @@ void PIC16DbgInfo::PopulateArrayTypeInfo (DIType Ty, unsigned short &TypeNo,
if (Element.getTag() == dwarf::DW_TAG_subrange_type) { if (Element.getTag() == dwarf::DW_TAG_subrange_type) {
TypeNo = TypeNo << PIC16Dbg::S_DERIVED; TypeNo = TypeNo << PIC16Dbg::S_DERIVED;
TypeNo = TypeNo | PIC16Dbg::DT_ARY; TypeNo = TypeNo | PIC16Dbg::DT_ARY;
DISubrange SubRange = DISubrange(Element.getNode()); DISubrange SubRange = DISubrange(Element);
Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1; Dimension[i] = SubRange.getHi() - SubRange.getLo() + 1;
// Each dimension is represented by 2 bytes starting at byte 9. // Each dimension is represented by 2 bytes starting at byte 9.
Aux[8+i*2+0] = Dimension[i]; Aux[8+i*2+0] = Dimension[i];
@ -111,7 +111,7 @@ void PIC16DbgInfo::PopulateStructOrUnionTypeInfo (DIType Ty,
unsigned short &TypeNo, unsigned short &TypeNo,
bool &HasAux, int Aux[], bool &HasAux, int Aux[],
std::string &TagName) { std::string &TagName) {
DICompositeType CTy = DICompositeType(Ty.getNode()); DICompositeType CTy = DICompositeType(Ty);
TypeNo = TypeNo << PIC16Dbg::S_BASIC; TypeNo = TypeNo << PIC16Dbg::S_BASIC;
if (Ty.getTag() == dwarf::DW_TAG_structure_type) if (Ty.getTag() == dwarf::DW_TAG_structure_type)
TypeNo = TypeNo | PIC16Dbg::T_STRUCT; TypeNo = TypeNo | PIC16Dbg::T_STRUCT;
@ -124,7 +124,7 @@ void PIC16DbgInfo::PopulateStructOrUnionTypeInfo (DIType Ty,
// llvm.dbg.composite* global variable. Since we need to revisit // llvm.dbg.composite* global variable. Since we need to revisit
// PIC16DebugInfo implementation anyways after the MDNodes based // PIC16DebugInfo implementation anyways after the MDNodes based
// framework is done, let us continue with the way it is. // framework is done, let us continue with the way it is.
std::string UniqueSuffix = "." + Ty.getNode()->getNameStr().substr(18); std::string UniqueSuffix = "." + Ty->getNameStr().substr(18);
TagName += UniqueSuffix; TagName += UniqueSuffix;
unsigned short size = CTy.getSizeInBits()/8; unsigned short size = CTy.getSizeInBits()/8;
// 7th and 8th byte represent size. // 7th and 8th byte represent size.
@ -303,7 +303,7 @@ void PIC16DbgInfo::EmitCompositeTypeElements (DICompositeType CTy,
bool HasAux = false; bool HasAux = false;
int ElementAux[PIC16Dbg::AuxSize] = { 0 }; int ElementAux[PIC16Dbg::AuxSize] = { 0 };
std::string TagName = ""; std::string TagName = "";
DIDerivedType DITy(Element.getNode()); DIDerivedType DITy(Element);
unsigned short ElementSize = DITy.getSizeInBits()/8; unsigned short ElementSize = DITy.getSizeInBits()/8;
// Get mangleddd name for this structure/union element. // Get mangleddd name for this structure/union element.
std::string MangMemName = DITy.getName().str() + SuffixNo; std::string MangMemName = DITy.getName().str() + SuffixNo;
@ -336,7 +336,7 @@ void PIC16DbgInfo::EmitCompositeTypeDecls(Module &M) {
CTy.getTag() == dwarf::DW_TAG_structure_type ) { CTy.getTag() == dwarf::DW_TAG_structure_type ) {
// Get the number after llvm.dbg.composite and make UniqueSuffix from // Get the number after llvm.dbg.composite and make UniqueSuffix from
// it. // it.
std::string DIVar = CTy.getNode()->getNameStr(); std::string DIVar = CTy->getNameStr();
std::string UniqueSuffix = "." + DIVar.substr(18); std::string UniqueSuffix = "." + DIVar.substr(18);
std::string MangledCTyName = CTy.getName().str() + UniqueSuffix; std::string MangledCTyName = CTy.getName().str() + UniqueSuffix;
unsigned short size = CTy.getSizeInBits()/8; unsigned short size = CTy.getSizeInBits()/8;

View File

@ -346,7 +346,7 @@ void X86AsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
// cast away const; DIetc do not take const operands for some reason. // cast away const; DIetc do not take const operands for some reason.
DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata())); DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata()));
if (V.getContext().isSubprogram()) if (V.getContext().isSubprogram())
O << DISubprogram(V.getContext().getNode()).getDisplayName() << ":"; O << DISubprogram(V.getContext()).getDisplayName() << ":";
O << V.getName(); O << V.getName();
O << " <- "; O << " <- ";
// Frame address. Currently handles register +- offset only. // Frame address. Currently handles register +- offset only.

View File

@ -344,7 +344,7 @@ static MDNode *UpdateInlinedAtInfo(MDNode *InsnMD, MDNode *TheCallMD) {
DILocation OrigLocation = ILoc.getOrigLocation(); DILocation OrigLocation = ILoc.getOrigLocation();
MDNode *NewLoc = TheCallMD; MDNode *NewLoc = TheCallMD;
if (OrigLocation.Verify()) if (OrigLocation.Verify())
NewLoc = UpdateInlinedAtInfo(OrigLocation.getNode(), TheCallMD); NewLoc = UpdateInlinedAtInfo(OrigLocation, TheCallMD);
Value *MDVs[] = { Value *MDVs[] = {
InsnMD->getOperand(0), // Line InsnMD->getOperand(0), // Line

View File

@ -886,7 +886,7 @@ void PromoteMem2Reg::PromoteSingleBlockAlloca(AllocaInst *AI, AllocaInfo &Info,
void PromoteMem2Reg::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI, void PromoteMem2Reg::ConvertDebugDeclareToDebugValue(DbgDeclareInst *DDI,
StoreInst *SI) { StoreInst *SI) {
DIVariable DIVar(DDI->getVariable()); DIVariable DIVar(DDI->getVariable());
if (!DIVar.getNode()) if (!DIVar)
return; return;
if (!DIF) if (!DIF)