[1/2] debug: Add new function ctf_debuginfo_p

Message ID 1626533058-12491-2-git-send-email-indu.bhagat@oracle.com
State New
Headers show
Series
  • Allow means for targets to opt out of CTF/BTF
Related show

Commit Message

Hongtao Liu via Gcc-patches July 17, 2021, 2:44 p.m.
gcc/Changelog:

	* flags.h (ctf_debuginfo_p): New function declaration.
	* opts.c (ctf_debuginfo_p): New function definition.
---
 gcc/flags.h | 4 ++++
 gcc/opts.c  | 8 ++++++++
 2 files changed, 12 insertions(+)

-- 
1.8.3.1

Patch

diff --git a/gcc/flags.h b/gcc/flags.h
index 85fd228..afedef0 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -44,6 +44,10 @@  const char * debug_set_names (uint32_t w_symbols);
 
 extern bool btf_debuginfo_p ();
 
+/* Return true iff CTF debug info is enabled.  */
+
+extern bool ctf_debuginfo_p ();
+
 /* Return true iff DWARF2 debug info is enabled.  */
 
 extern bool dwarf_debuginfo_p ();
diff --git a/gcc/opts.c b/gcc/opts.c
index 25282f7..93366e6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -135,6 +135,14 @@  btf_debuginfo_p ()
   return (write_symbols & BTF_DEBUG);
 }
 
+/* Return TRUE iff CTF debug info is enabled.  */
+
+bool
+ctf_debuginfo_p ()
+{
+  return (write_symbols & CTF_DEBUG);
+}
+
 /* Return TRUE iff dwarf2 debug info is enabled.  */
 
 bool