aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-07-01 18:20:30 +0000
committerManman Ren <mren@apple.com>2013-07-01 18:20:30 +0000
commitc7b61c638b912eaa7f85c7794589a253a3669162 (patch)
tree7d4518057f0d6a66477b3dd6dad57fdbaa4b63b5
parent222e781d92541017c3a9c5dd40cb52e334cdb86f (diff)
downloadexternal_llvm-c7b61c638b912eaa7f85c7794589a253a3669162.zip
external_llvm-c7b61c638b912eaa7f85c7794589a253a3669162.tar.gz
external_llvm-c7b61c638b912eaa7f85c7794589a253a3669162.tar.bz2
Debug Info: Scope of a DebugLoc should not be null.
No functionality change. Remove handling for the null case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185354 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/IR/DebugInfo.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index d932adc..1ab39b6 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/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 << "<unknown>";
+ CommentOS << Scope.getFilename();
CommentOS << ':' << DL.getLine();
if (DL.getCol() != 0)
CommentOS << ':' << DL.getCol();