[PATCH] D92958: [gn build] Add gn arg to only emit line numbers for debug info
Arthur Eubanks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 9 11:51:43 PST 2020
aeubanks created this revision.
aeubanks added a reviewer: thakis.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92958
Files:
llvm/utils/gn/build/BUILD.gn
llvm/utils/gn/build/buildflags.gni
Index: llvm/utils/gn/build/buildflags.gni
===================================================================
--- llvm/utils/gn/build/buildflags.gni
+++ llvm/utils/gn/build/buildflags.gni
@@ -2,6 +2,9 @@
# Whether to build with debug information.
is_debug = false
+ # Whether to build with debug information only containing line info. Useful for stack traces.
+ is_debug_lines = false
+
# Whether to build with tsan.
use_tsan = false
Index: llvm/utils/gn/build/BUILD.gn
===================================================================
--- llvm/utils/gn/build/BUILD.gn
+++ llvm/utils/gn/build/BUILD.gn
@@ -72,9 +72,12 @@
ldflags += [ "-mmacosx-version-min=10.10" ]
}
+ assert(!(is_debug && is_debug_lines), "Cannot specify both is_debug and is_debug_lines")
if (host_os != "win") {
if (is_debug) {
cflags += [ "-g" ]
+ } else if (is_debug_lines) {
+ cflags += [ "-g1" ]
}
if (is_optimized) {
cflags += [ "-O3" ]
@@ -88,11 +91,14 @@
"-fvisibility-inlines-hidden",
]
} else {
- if (is_debug) {
+ if (is_debug || is_debug_lines) {
cflags += [
"/Zi",
"/FS",
]
+ if (is_debug_lines) {
+ cflags += [ "/Zd" ]
+ }
ldflags += [ "/DEBUG" ]
# Speed up links with ghash on windows.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92958.310600.patch
Type: text/x-patch
Size: 1327 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201209/297c3fa4/attachment.bin>
More information about the llvm-commits
mailing list