[PATCH] D41364: move UseDwarfRangesBaseAddressSpecifier to front end flag

Modupe Theko Lekena via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 21 07:46:12 PST 2018


mlekena updated this revision to Diff 135257.
mlekena added a comment.



1. Updating https://reviews.llvm.org/D41364: move UseDwarfRangesBaseAddressSpecifier to front end flag #
2. Enter a brief description of the changes included in this update.
3. The first line is used as subject, next lines as comment. #
4. If you intended to create a new revision, use:
5. $ arc diff --create

Remove commented code as recommended to adhere to developers guide


https://reviews.llvm.org/D41364

Files:
  include/llvm/MC/MCTargetOptions.h
  lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  test/DebugInfo/X86/range_reloc.ll
  tools/llc/llc.cpp


Index: tools/llc/llc.cpp
===================================================================
--- tools/llc/llc.cpp
+++ tools/llc/llc.cpp
@@ -166,6 +166,10 @@
 
 static int compileModule(char **, LLVMContext &);
 
+static cl::opt<bool> UseDwarfRangesBaseAddressSpecifier(
+    "use-dwarf-ranges-base-address-specifier", cl::Hidden,
+    cl::desc("Use base address specifiers in debug_ranges"), cl::init(false));
+
 static std::unique_ptr<ToolOutputFile> GetOutputStream(const char *TargetName,
                                                        Triple::OSType OS,
                                                        const char *ProgName) {
@@ -451,6 +455,7 @@
   Options.MCOptions.PreserveAsmComments = PreserveComments;
   Options.MCOptions.IASSearchPaths = IncludeDirs;
   Options.MCOptions.SplitDwarfFile = SplitDwarfFile;
+  Options.MCOptions.UseDwarfRangesBaseAddressSpecifier = UseDwarfRangesBaseAddressSpecifier;
 
   std::unique_ptr<TargetMachine> Target(TheTarget->createTargetMachine(
       TheTriple.getTriple(), CPUStr, FeaturesStr, Options, getRelocModel(),
Index: test/DebugInfo/X86/range_reloc.ll
===================================================================
--- test/DebugInfo/X86/range_reloc.ll
+++ test/DebugInfo/X86/range_reloc.ll
@@ -1,4 +1,4 @@
-; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - -use-dwarf-ranges-base-address-specifier | FileCheck --check-prefix=COMMON --check-prefix=BASE %s
+; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu -use-dwarf-ranges-base-address-specifier %s -o  - | FileCheck --check-prefix=COMMON --check-prefix=BASE %s
 ; RUN: llc -filetype=asm -mtriple=x86_64-pc-linux-gnu %s -o - | FileCheck --check-prefix=COMMON --check-prefix=NOBASE %s
 
 ; Group ranges in a range list that apply to the same section and use a base
Index: lib/CodeGen/AsmPrinter/DwarfDebug.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -85,10 +85,6 @@
 DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden,
                          cl::desc("Disable debug info printing"));
 
-static cl::opt<bool> UseDwarfRangesBaseAddressSpecifier(
-    "use-dwarf-ranges-base-address-specifier", cl::Hidden,
-    cl::desc("Use base address specifiers in debug_ranges"), cl::init(false));
-
 static cl::opt<bool> GenerateARangeSection("generate-arange-section",
                                            cl::Hidden,
                                            cl::desc("Generate dwarf aranges"),
@@ -1909,7 +1905,7 @@
         // contrubutions.
         auto *Base = CUBase;
         if (!Base && P.second.size() > 1 &&
-            UseDwarfRangesBaseAddressSpecifier) {
+            Asm->TM.Options.MCOptions.UseDwarfRangesBaseAddressSpecifier) {
           BaseIsSet = true;
           // FIXME/use care: This may not be a useful base address if it's not
           // the lowest address/range in this object.
Index: include/llvm/MC/MCTargetOptions.h
===================================================================
--- include/llvm/MC/MCTargetOptions.h
+++ include/llvm/MC/MCTargetOptions.h
@@ -62,6 +62,9 @@
   std::string ABIName;
   std::string SplitDwarfFile;
 
+  /// Enable base address specification in dwarf ranges 
+  bool UseDwarfRangesBaseAddressSpecifier;
+
   /// Additional paths to search for `.include` directives when using the
   /// integrated assembler.
   std::vector<std::string> IASSearchPaths;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41364.135257.patch
Type: text/x-patch
Size: 3493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180221/19cb4230/attachment.bin>


More information about the llvm-commits mailing list