]> sourceware.org Git - systemtap.git/commitdiff
Fix -Woverloaded-virtual warnings when building with clang
authorTimm Bäder <tbaeder@redhat.com>
Wed, 19 May 2021 20:38:30 +0000 (16:38 -0400)
committerAaron Merey <amerey@redhat.com>
Wed, 19 May 2021 20:38:30 +0000 (16:38 -0400)
Satisfy clang by removing option for non-nested signature printing from
implementations of printsig and declare derived_probe::printsig with 'override'.

Add function derived_probe::printsig_nonest to perform non-nested signature
printing.

elaborate.cxx
elaborate.h
main.cxx
tapsets.cxx

index a8b38d7b6ec326c3c2a72cf669c1b1178e306626..d48440bf539b3c6b6499ce93546b3f803bd85241 100644 (file)
@@ -78,14 +78,17 @@ derived_probe::derived_probe (probe *p, probe_point *l, bool rewrite_loc):
   this->locations.push_back (l);
 }
 
-
 void
-derived_probe::printsig (ostream& o, bool nest) const
+derived_probe::printsig_nonest (ostream& o) const
 {
   probe::printsig (o);
+}
 
-  if (nest)
-    printsig_nested (o);
+void
+derived_probe::printsig (ostream& o) const
+{
+  probe::printsig (o);
+  printsig_nested (o);
 }
 
 void
index 8600686204afd13f16a94a42b0ad0577e3ccc2de..935027f408469c0e8d755e5bd78b263acfd67043 100644 (file)
@@ -203,7 +203,8 @@ struct derived_probe: public probe
   virtual void join_group (systemtap_session& s) = 0;
   virtual probe_point* sole_location () const;
   virtual probe_point* script_location () const;
-  virtual void printsig (std::ostream &o, bool nest=true) const;
+  virtual void printsig (std::ostream &o) const override;
+  void printsig_nonest (std::ostream &o) const;
   // return arguments of probe if there
   virtual void getargs (std::list<std::string> &) const {}
   void printsig_nested (std::ostream &o) const;
index c05279d4276205a8b766fbae9aff8a2df815d021..bc004b61b020adfa273f498a1a55efa78b364974 100644 (file)
--- a/main.cxx
+++ b/main.cxx
@@ -177,7 +177,7 @@ printscript(systemtap_session& s, ostream& o)
                     {
                       // We want to print the probe point signature (without the nested components).
                       std::ostringstream sig;
-                      p->printsig(sig, false);
+                      p->printsig_nonest(sig);
 
                       if (s.dump_mode == systemtap_session::dump_matched_probes_vars && isatty(STDOUT_FILENO))
                         o << s.colorize(sig.str(), "source");
index ab0b38171ed56a2cd705508d61de8e092240dc0c..9f28612b92522258300107af5ce88b91a2863a1f 100644 (file)
@@ -559,7 +559,7 @@ struct dwarf_derived_probe: public generic_kprobe_derived_probe
   interned_string user_lib;
   bool access_vars;
 
-  void printsig (std::ostream &o, bool nest=true) const;
+  void printsig (std::ostream &o) const;
   virtual void join_group (systemtap_session& s);
   void emit_probe_local_init(systemtap_session& s, translator_output * o);
   void getargs(std::list<std::string> &arg_set) const;
@@ -5359,7 +5359,7 @@ dwarf_atvar_expanding_visitor::visit_atvar_op (atvar_op* e)
 
 
 void
-dwarf_derived_probe::printsig (ostream& o, bool nest) const
+dwarf_derived_probe::printsig (ostream& o) const
 {
   // Instead of just printing the plain locations, we add a PC value
   // as a comment as a way of telling e.g. apart multiple inlined
@@ -5371,8 +5371,7 @@ dwarf_derived_probe::printsig (ostream& o, bool nest) const
   else
     o << " /* pc=" << section << "+0x" << hex << addr << dec << " */";
 
-  if (nest)
-    printsig_nested (o);
+  printsig_nested (o);
 }
 
 
@@ -10230,7 +10229,7 @@ struct kprobe_derived_probe: public generic_kprobe_derived_probe
   string path;
   string library;
   bool access_var;
-  void printsig (std::ostream &o, bool nest=true) const;
+  void printsig (std::ostream &o) const;
   void join_group (systemtap_session& s);
 };
 
@@ -10359,8 +10358,9 @@ kprobe_derived_probe::kprobe_derived_probe (systemtap_session& sess,
   this->sole_location()->components = comps;
 }
 
-void kprobe_derived_probe::printsig (ostream& o, bool nest) const
+void kprobe_derived_probe::printsig (ostream& o) const
 {
+  bool nest = true;
   sole_location()->print (o);
   o << " /* " << " name = " << symbol_name << "*/";
 
@@ -10592,7 +10592,7 @@ struct hwbkpt_derived_probe: public derived_probe
   string symbol_name;
   unsigned int hwbkpt_access,hwbkpt_len;
 
-  void printsig (std::ostream &o, bool nest) const;
+  void printsig (std::ostream &o) const;
   void join_group (systemtap_session& s);
 };
 
@@ -10659,12 +10659,10 @@ hwbkpt_derived_probe::hwbkpt_derived_probe (probe *base,
   this->sole_location()->components = comps;
 }
 
-void hwbkpt_derived_probe::printsig (ostream& o, bool nest) const
+void hwbkpt_derived_probe::printsig (ostream& o) const
 {
   sole_location()->print (o);
-
-  if (nest)
-    printsig_nested (o);
+  printsig_nested (o);
 }
 
 void hwbkpt_derived_probe::join_group (systemtap_session& s)
This page took 0.046885 seconds and 5 git commands to generate.