summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2014-11-20 15:46:59 +0000
committerFrederic Riss <friss@apple.com>2014-11-20 15:46:59 +0000
commitc3a9d7dfbf1ceaa238b18984da2596566840a569 (patch)
tree02be033b762a55a75c5e8c381057a7bdd0bf7ee4 /clang/lib/CodeGen/CGDebugInfo.cpp
parent2c15e8ccce4158570d02441fb34d5bb24ba3f868 (diff)
downloadbcm5719-llvm-c3a9d7dfbf1ceaa238b18984da2596566840a569.tar.gz
bcm5719-llvm-c3a9d7dfbf1ceaa238b18984da2596566840a569.zip
Prepare for the DIBuilder populating DISubprogram's Variables with null.
This is a followup to r222373. A better solution to the problem solved there is to not create the leaked nodes at all (we know that they will never be used for forward declared functions anyway). To avoid bot breakage in the interval between the cfe and llvm commits, add a check that the nMDNode is not null before deleting it. This code can completely go away after the LLVM part is in. llvm-svn: 222433
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 03a0cd92c25..343b3432076 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -3417,7 +3417,8 @@ void CGDebugInfo::finalize() {
// to get RAUWed upon DIBuilder finalization. Do not leak these
// nodes for the temporary functions we are about to delete.
if (FwdDecl.isSubprogram())
- llvm::MDNode::deleteTemporary(llvm::DISubprogram(FwdDecl).getVariablesNodes());
+ if (llvm::MDNode *Vars = llvm::DISubprogram(FwdDecl).getVariablesNodes())
+ llvm::MDNode::deleteTemporary(Vars);
FwdDecl.replaceAllUsesWith(CGM.getLLVMContext(),
llvm::DIDescriptor(cast<llvm::MDNode>(VH)));
OpenPOWER on IntegriCloud