[codeview] Fix crash when handling qualified void types

The DIType* for void is the null pointer. A null DIType can never be a
qualified type, so we can just exit the loop at this point and go to
getTypeIndex(BaseTy).

Fixes PR27984

llvm-svn: 271550
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 040bef5..ba0c7ca 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -914,8 +914,7 @@
   ModifierOptions Mods = ModifierOptions::None;
   bool IsModifier = true;
   const DIType *BaseTy = Ty;
-  while (IsModifier) {
-    assert(BaseTy);
+  while (IsModifier && BaseTy) {
     // FIXME: Need to add DWARF tag for __unaligned.
     switch (BaseTy->getTag()) {
     case dwarf::DW_TAG_const_type: