[PATCH] D44605: [Driver] Default to DWARF 5 for Fuchsia

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 17 18:27:49 PDT 2018


phosek created this revision.
phosek added a reviewer: mcgrathr.
Herald added subscribers: cfe-commits, JDevlieghere, aprantl.

We use DWARF 5 on Fuchsia, make it the toolchain default.


Repository:
  rC Clang

https://reviews.llvm.org/D44605

Files:
  clang/lib/Driver/ToolChains/Fuchsia.h
  clang/test/Driver/fuchsia.c


Index: clang/test/Driver/fuchsia.c
===================================================================
--- clang/test/Driver/fuchsia.c
+++ clang/test/Driver/fuchsia.c
@@ -50,6 +50,10 @@
 // CHECK-RELOCATABLE-NOT: "--build-id"
 // CHECK-RELOCATABLE: "-r"
 
+// RUN: %clang %s -### --target=x86_64-unknown-fuchsia -g 2>&1 \
+// RUN:     | FileCheck %s -check-prefix=CHECK-DEBUG
+// CHECK-DEBUG: "-dwarf-version=5"
+
 // RUN: %clang %s -### --target=x86_64-unknown-fuchsia \
 // RUN:     -fsanitize=safe-stack 2>&1 \
 // RUN:     | FileCheck %s -check-prefix=CHECK-SAFESTACK
Index: clang/lib/Driver/ToolChains/Fuchsia.h
===================================================================
--- clang/lib/Driver/ToolChains/Fuchsia.h
+++ clang/lib/Driver/ToolChains/Fuchsia.h
@@ -56,6 +56,7 @@
   bool isPICDefault() const override { return false; }
   bool isPIEDefault() const override { return true; }
   bool isPICDefaultForced() const override { return false; }
+  unsigned GetDefaultDwarfVersion() const override { return 5; }
   llvm::DebuggerKind getDefaultDebuggerTuning() const override {
     return llvm::DebuggerKind::GDB;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44605.138838.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180318/73ba1b7e/attachment.bin>


More information about the cfe-commits mailing list