[DEBUG_INFO, NVPTX] Do not emit .debug_loc section.

Summary:
.debug_loc section is not supported for NVPTX target. If there is an
object whose location can change during its lifetime, we do not generate
debug location info for this variable.

Reviewers: echristo

Subscribers: jholewinski, JDevlieghere, llvm-commits

Differential Revision: https://reviews.llvm.org/D48730

llvm-svn: 335976
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index f01d680..54f0e5b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -276,6 +276,9 @@
   /// temp symbols inside DWARF sections.
   bool UseSectionsAsReferences = false;
 
+  ///Allow emission of the .debug_loc section.
+  bool UseLocSection = true;
+
   /// DWARF5 Experimental Options
   /// @{
   AccelTableKind TheAccelTableKind;
@@ -526,7 +529,7 @@
   /// Returns whether to use inline strings.
   bool useInlineStrings() const { return UseInlineStrings; }
 
-  /// Returns whether GNU oub sections should be emitted.
+  /// Returns whether GNU pub sections should be emitted.
   bool usePubSections() const { return UsePubSections; }
 
   /// Returns whether ranges section should be emitted.
@@ -537,6 +540,9 @@
     return UseSectionsAsReferences;
   }
 
+  /// Returns whether .debug_loc section should be emitted.
+  bool useLocSection() const { return UseLocSection; }
+
   // Experimental DWARF5 features.
 
   /// Returns what kind (if any) of accelerator tables to emit.