do not rely on the implicit-dereference semantics of dyn_cast_or_null

llvm-svn: 114281
This commit is contained in:
Gabor Greif 2010-09-18 13:00:17 +00:00
parent 239a07c297
commit bf98608a3d
1 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ llvm::DIDescriptor CGDebugInfo::getContextDescriptor(const Decl *Context,
llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator
I = RegionMap.find(Context);
if (I != RegionMap.end())
return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(I->second));
return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(&*I->second));
// Check namespace.
if (const NamespaceDecl *NSDecl = dyn_cast<NamespaceDecl>(Context))
@ -1478,7 +1478,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
llvm::DenseMap<const FunctionDecl *, llvm::WeakVH>::iterator
FI = SPCache.find(FD);
if (FI != SPCache.end()) {
llvm::DIDescriptor SP(dyn_cast_or_null<llvm::MDNode>(FI->second));
llvm::DIDescriptor SP(dyn_cast_or_null<llvm::MDNode>(&*FI->second));
if (SP.isSubprogram() && llvm::DISubprogram(SP).isDefinition()) {
llvm::MDNode *SPN = SP;
RegionStack.push_back(SPN);