From 08016a657ceb894928a909c39cc5ceee85a0e20b Mon Sep 17 00:00:00 2001 From: Manman Ren Date: Mon, 1 Jul 2013 18:20:30 +0000 Subject: [PATCH] Debug Info: Scope of a DebugLoc should not be null. No functionality change. Remove handling for the null case. llvm-svn: 185354 --- llvm/lib/IR/DebugInfo.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index d932adc7f3c0..1ab39b6fe8cd 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/lib/IR/DebugInfo.cpp @@ -1213,13 +1213,10 @@ static void printDebugLoc(DebugLoc DL, raw_ostream &CommentOS, const LLVMContext &Ctx) { if (!DL.isUnknown()) { // Print source line info. DIScope Scope(DL.getScope(Ctx)); - assert((!Scope || Scope.isScope()) && - "Scope of a DebugLoc should be null or a DIScope."); + assert(Scope.isScope() && + "Scope of a DebugLoc should be a DIScope."); // Omit the directory, because it's likely to be long and uninteresting. - if (Scope) - CommentOS << Scope.getFilename(); - else - CommentOS << ""; + CommentOS << Scope.getFilename(); CommentOS << ':' << DL.getLine(); if (DL.getCol() != 0) CommentOS << ':' << DL.getCol();