[llvm-commits] [dragonegg] r103345 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Sat May 8 12:41:28 PDT 2010
Author: baldrick
Date: Sat May 8 14:41:28 2010
New Revision: 103345
URL: http://llvm.org/viewvc/llvm-project?rev=103345&view=rev
Log:
Port commit 103274 (dpatel) from llvm-gcc:
Avoid use of DIDescriptor::getNode(). Use overloaded operators instead.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=103345&r1=103344&r2=103345&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sat May 8 14:41:28 2010
@@ -258,11 +258,11 @@
DISubprogram SPDecl(cast<MDNode>(I->second));
DISubprogram SP =
DebugFactory.CreateSubprogramDefinition(SPDecl);
- SPDecl.getNode()->replaceAllUsesWith(SP.getNode());
+ SPDecl->replaceAllUsesWith(SP);
// Push function on region stack.
- RegionStack.push_back(WeakVH(SP.getNode()));
- RegionMap[FnDecl] = WeakVH(SP.getNode());
+ RegionStack.push_back(WeakVH(SP));
+ RegionMap[FnDecl] = WeakVH(SP);
return;
}
@@ -285,11 +285,11 @@
DISubprogram SPDecl(cast<MDNode>(I->second));
DISubprogram SP =
DebugFactory.CreateSubprogramDefinition(SPDecl);
- SPDecl.getNode()->replaceAllUsesWith(SP.getNode());
+ SPDecl->replaceAllUsesWith(SP);
// Push function on region stack.
- RegionStack.push_back(WeakVH(SP.getNode()));
- RegionMap[FnDecl] = WeakVH(SP.getNode());
+ RegionStack.push_back(WeakVH(SP));
+ RegionMap[FnDecl] = WeakVH(SP);
return;
}
@@ -323,11 +323,11 @@
Virtuality, VIndex, ContainingType);
- SPCache[FnDecl] = WeakVH(SP.getNode());
+ SPCache[FnDecl] = WeakVH(SP);
// Push function on region stack.
- RegionStack.push_back(WeakVH(SP.getNode()));
- RegionMap[FnDecl] = WeakVH(SP.getNode());
+ RegionStack.push_back(WeakVH(SP));
+ RegionMap[FnDecl] = WeakVH(SP);
}
/// getOrCreateNameSpace - Get name space descriptor for the tree node.
@@ -342,7 +342,7 @@
DebugFactory.CreateNameSpace(Context, GetNodeName(Node),
getOrCreateFile(Loc.file), Loc.line);
- NameSpaceCache[Node] = WeakVH(DNS.getNode());
+ NameSpaceCache[Node] = WeakVH(DNS);
return DNS;
}
@@ -358,12 +358,12 @@
if (TYPE_P (Node)) {
DIType Ty = getOrCreateType(Node);
- return DIDescriptor(Ty.getNode());
+ return DIDescriptor(Ty);
} else if (DECL_P (Node)) {
if (TREE_CODE (Node) == NAMESPACE_DECL) {
DIDescriptor NSContext = findRegion(DECL_CONTEXT(Node));
DINameSpace NS = getOrCreateNameSpace(Node, NSContext);
- return DIDescriptor(NS.getNode());
+ return DIDescriptor(NS);
}
return findRegion (DECL_CONTEXT (Node));
}
@@ -416,7 +416,7 @@
// Insert an llvm.dbg.declare into the current block.
Instruction *Call = DebugFactory.InsertDeclare(AI, D,
Builder.GetInsertBlock());
- Call->setDebugLoc(DebugLoc::get(CurLineNo, 0, VarScope.getNode()));
+ Call->setDebugLoc(DebugLoc::get(CurLineNo, 0, VarScope));
}
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
@@ -544,11 +544,12 @@
getOrCreateFile(main_input_filename),
0, 0, 0, 0, 0,
llvm::DIType(), llvm::DIArray());
- llvm::TrackingVH<llvm::MDNode> FwdTypeNode = FwdType.getNode();
- TypeCache[type] = WeakVH(FwdType.getNode());
+ llvm::MDNode *FTN = FwdType;
+ llvm::TrackingVH<llvm::MDNode> FwdTypeNode = FTN;
+ TypeCache[type] = WeakVH(FwdType);
// Push the struct on region stack.
- RegionStack.push_back(WeakVH(FwdType.getNode()));
- RegionMap[type] = WeakVH(FwdType.getNode());
+ RegionStack.push_back(WeakVH(FwdType));
+ RegionMap[type] = WeakVH(FwdType);
llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
@@ -618,7 +619,7 @@
0 /*offset */,
0 /*flags*/,
FromTy);
- TypeCache[TyName] = WeakVH(Ty.getNode());
+ TypeCache[TyName] = WeakVH(Ty);
return Ty;
}
@@ -803,12 +804,13 @@
return FwdDecl;
// Insert into the TypeCache so that recursive uses will find it.
- llvm::TrackingVH<llvm::MDNode> FwdDeclNode = FwdDecl.getNode();
- TypeCache[type] = WeakVH(FwdDecl.getNode());
+ llvm::MDNode *FDN = FwdDecl;
+ llvm::TrackingVH<llvm::MDNode> FwdDeclNode = FDN;
+ TypeCache[type] = WeakVH(FwdDecl);
// Push the struct on region stack.
- RegionStack.push_back(WeakVH(FwdDecl.getNode()));
- RegionMap[type] = WeakVH(FwdDecl.getNode());
+ RegionStack.push_back(WeakVH(FwdDecl));
+ RegionMap[type] = WeakVH(FwdDecl);
// Convert all the elements.
llvm::SmallVector<llvm::DIDescriptor, 16> EltTys;
@@ -932,7 +934,7 @@
Virtuality, VIndex, ContainingType,
DECL_ARTIFICIAL (Member));
EltTys.push_back(SP);
- SPCache[Member] = WeakVH(SP.getNode());
+ SPCache[Member] = WeakVH(SP);
}
}
@@ -956,8 +958,8 @@
Loc.line,
NodeSizeInBits(type), NodeAlignInBits(type),
0, SFlags, llvm::DIType(), Elements,
- RunTimeLang, ContainingType.getNode());
- RegionMap[type] = WeakVH(RealDecl.getNode());
+ RunTimeLang, ContainingType);
+ RegionMap[type] = WeakVH(RealDecl);
// Now that we have a real decl for the struct, replace anything using the
// old decl with the new one. This will recursively update the debug info.
@@ -987,7 +989,7 @@
0 /*offset */,
0 /*flags*/,
MainTy);
- TypeCache[TyDef] = WeakVH(Ty.getNode());
+ TypeCache[TyDef] = WeakVH(Ty);
return Ty;
}
}
@@ -1019,7 +1021,7 @@
MainTy);
if (TYPE_VOLATILE(type) || TYPE_READONLY(type)) {
- TypeCache[type] = WeakVH(Ty.getNode());
+ TypeCache[type] = WeakVH(Ty);
return Ty;
}
@@ -1103,7 +1105,7 @@
Ty = createBasicType(type);
break;
}
- TypeCache[type] = WeakVH(Ty.getNode());
+ TypeCache[type] = WeakVH(Ty);
return Ty;
}
More information about the llvm-commits
mailing list