Collapse conditional and add an assert for unhandled scope types.
authorEric Christopher <echristo@gmail.com>
Fri, 26 Jul 2013 17:45:19 +0000 (17:45 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 26 Jul 2013 17:45:19 +0000 (17:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187224 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DebugInfo.cpp

index 369895ce568035ca324d4e2c7bba7ec0229a4a44..4d5ae260f6244e9e3cf53cbbaa05651f5a02019a 100644 (file)
@@ -711,9 +711,7 @@ DIScope DIScope::getContext() const {
   if (isNameSpace())
     return DINameSpace(DbgNode).getContext();
 
-  if (isFile() || isCompileUnit())
-    return DIScope();
-
+  assert(isFile() || isCompileUnit() && "Unhandled type of scope.");
   return DIScope();
 }