forked from OSchip/llvm-project
do not rely on the implicit-dereference semantics of dyn_cast_or_null
llvm-svn: 114281
This commit is contained in:
parent
239a07c297
commit
bf98608a3d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue