From: Duncan P. N. Exon Smith Date: Tue, 9 Dec 2014 19:22:40 +0000 (+0000) Subject: Fix a GCC error from r223803 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b37f14faeda516a96f5f13dd4dd03b86931f0c7e;p=clang Fix a GCC error from r223803 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223814 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 20603f44af..5bf460f2b8 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -2663,10 +2663,12 @@ void CGDebugInfo::EmitLocation(CGBuilderTy &Builder, SourceLocation Loc, /// CreateLexicalBlock - Creates a new lexical block node and pushes it on /// the stack. void CGDebugInfo::CreateLexicalBlock(SourceLocation Loc) { + llvm::MDNode *Back = nullptr; + if (!LexicalBlockStack.empty()) + Back = LexicalBlockStack.back().get(); llvm::DIDescriptor D = DBuilder.createLexicalBlock( - llvm::DIDescriptor(LexicalBlockStack.empty() ? nullptr - : LexicalBlockStack.back()), - getOrCreateFile(CurLoc), getLineNumber(CurLoc), getColumnNumber(CurLoc)); + llvm::DIDescriptor(Back), getOrCreateFile(CurLoc), getLineNumber(CurLoc), + getColumnNumber(CurLoc)); llvm::MDNode *DN = D; LexicalBlockStack.emplace_back(DN); }