diff options
author | Adrian Prantl <aprantl@apple.com> | 2016-02-08 17:03:28 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2016-02-08 17:03:28 +0000 |
commit | ff9d83ceb383ca782bad26857123d37dc947d363 (patch) | |
tree | 0842e8d11a633e91ab8d0be8d7c42d56f4515a3c /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | ea63a7f512dc25451b9da06653d966397fa9b758 (diff) | |
download | bcm5719-llvm-ff9d83ceb383ca782bad26857123d37dc947d363.tar.gz bcm5719-llvm-ff9d83ceb383ca782bad26857123d37dc947d363.zip |
Use llvm::TempDIScope instead of manually deleting a temporary MDNode.
llvm-svn: 260113
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 3da0765d375..52bd805b81c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -2056,20 +2056,19 @@ llvm::DIType *CGDebugInfo::CreateEnumType(const EnumType *Ty) { // It is possible for enums to be created as part of their own // declcontext. We need to cache a placeholder to avoid the type being // created twice before hitting the cache. - llvm::DIScope *TmpContext = DBuilder.createReplaceableCompositeType( - llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0); + llvm::TempDIScope TmpContext(DBuilder.createReplaceableCompositeType( + llvm::dwarf::DW_TAG_enumeration_type, "", TheCU, DefUnit, 0)); unsigned Line = getLineNumber(ED->getLocation()); StringRef EDName = ED->getName(); llvm::DIType *RetTy = DBuilder.createReplaceableCompositeType( - llvm::dwarf::DW_TAG_enumeration_type, EDName, TmpContext, DefUnit, Line, - 0, Size, Align, llvm::DINode::FlagFwdDecl, FullName); + llvm::dwarf::DW_TAG_enumeration_type, EDName, TmpContext.get(), DefUnit, + Line, 0, Size, Align, llvm::DINode::FlagFwdDecl, FullName); // Cache the enum type so it is available when building the declcontext // and replace the declcontect with the real thing. TypeCache[Ty].reset(RetTy); TmpContext->replaceAllUsesWith(getDeclContextDescriptor(ED)); - llvm::MDNode::deleteTemporary(TmpContext); ReplaceMap.emplace_back( std::piecewise_construct, std::make_tuple(Ty), |