Add an accessor method to DwarfWriter to tell of debugging info should be emitted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65092 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index 4f810c1..4736cca 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -640,7 +640,8 @@
   }
   O << "\";\n\n";
 
-  O << "  if (TAI->doesSupportDebugInformation()) {\n"
+  O << "  if (TAI->doesSupportDebugInformation() &&\n"
+    << "      DW->ShouldEmitDwarfDebug()) {\n"
     << "    const MachineFunction *MF = MI->getParent()->getParent();\n"
     << "    DebugLoc CurDL = MI->getDebugLoc();\n\n"
     << "    if (!CurDL.isUnknown()) {\n"