]> granicus.if.org Git - clang/commitdiff
Fix a GCC error from r223803
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 9 Dec 2014 19:22:40 +0000 (19:22 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 9 Dec 2014 19:22:40 +0000 (19:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223814 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp

index 20603f44afb4d64e472228ae4166ba5d956375f0..5bf460f2b82d918688d3d3aa8bc0faee1f72fe69 100644 (file)
@@ -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);
 }