[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 11/11] abg-writer: drop deprecated API



Drop the deprecated overloads for write_translation_unit, write_corpus,
write_corpus_group. Also remove the deprecation facilities as they are
note used anymore.

	* include/abg-fwd.h: drop ABG_DEPRECATED macro
	* include/abg-writer.h: drop deprecated declarations
	* src/abg-writer.cc: drop deprecated definitions

Signed-off-by: Matthias Maennich <maennich@google.com>
---
 include/abg-fwd.h    |   9 --
 include/abg-writer.h |  44 ---------
 src/abg-writer.cc    | 225 -------------------------------------------
 3 files changed, 278 deletions(-)

diff --git a/include/abg-fwd.h b/include/abg-fwd.h
index e9258008f963..ddec06d8d29c 100644
--- a/include/abg-fwd.h
+++ b/include/abg-fwd.h
@@ -1342,14 +1342,5 @@ dump_decl_location(const decl_base_sptr&);
 #define ABG_ASSERT(cond) do {({bool __abg_cond__ = (cond); assert(__abg_cond__); !!__abg_cond__;});} while (false)
 #endif
 
-/// Define ABG_DEPRECATED to allow marking parts of the API deprecated without
-/// actually removing it. This allows to keep compatible (yet incomplete) APIs
-/// around for a transition period into a major version.
-#ifdef __GNUC__
-#define ABG_DEPRECATED __attribute__((deprecated))
-#else
-#define ABG_DEPRECATED
-#endif
-
 } // end namespace abigail
 #endif // __ABG_IRFWD_H__
diff --git a/include/abg-writer.h b/include/abg-writer.h
index 3a1f2f1dcea8..661c217ac565 100644
--- a/include/abg-writer.h
+++ b/include/abg-writer.h
@@ -85,18 +85,6 @@ write_translation_unit(write_context&	       ctxt,
 		       const translation_unit& tu,
 		       const unsigned	       indent);
 
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
-		       unsigned		       indent,
-		       std::ostream&	       out,
-		       const bool	       annotate = false);
-
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
-		       unsigned		       indent,
-		       const string&	       path,
-		       const bool	       annotate = false);
-
 bool
 write_corpus_to_archive(const corpus& corp,
 			const string& path,
@@ -116,43 +104,11 @@ write_corpus(write_context&	ctxt,
 	     unsigned		indent,
 	     bool		member_of_group = false);
 
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr& corpus, unsigned indent, write_context& ctxt);
-
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
-	     unsigned	       indent,
-	     std::ostream&     out,
-	     const bool	       annotate = false);
-
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
-	     unsigned	       indent,
-	     const string&     path,
-	     const bool	       annotate = false);
-
 bool
 write_corpus_group(write_context&	    ctx,
 		   const corpus_group_sptr& group,
 		   unsigned		    indent);
 
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
-		   unsigned		    indent,
-		   write_context&	    ctxt);
-
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
-		   unsigned		    indent,
-		   std::ostream&	    out,
-		   const bool		    annotate = false);
-
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
-		   unsigned		    indent,
-		   const string&	    path,
-		   const bool		    annotate = false);
-
 }// end namespace xml_writer
 }// end namespace abigail
 
diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index d3c85362b488..7b664931d819 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -2061,82 +2061,6 @@ write_translation_unit(write_context&	       ctxt,
   return true;
 }
 
-/// Serialize a translation unit to an output stream.
-///
-/// @param tu the translation unit to serialize.
-///
-/// @param indent how many indentation spaces to use during the
-/// serialization.
-///
-/// @param out the output stream to serialize the translation unit to.
-///
-/// @param annotate whether to annotate the output with debug information
-///
-/// @deprecated use write_translation_unit(ctct, tu, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
-		       unsigned		       indent,
-		       std::ostream&	       out,
-		       const bool	       annotate)
-{
-  write_context ctxt(tu.get_environment(), out);
-  set_annotate(ctxt, annotate);
-  return write_translation_unit(ctxt, tu, indent);
-}
-
-/// Serialize a translation unit to a file.
-///
-/// @param tu the translation unit to serialize.
-///
-/// @param indent how many indentation spaces to use during the
-/// serialization.
-///
-/// @param path the file to serialize the translation unit to.
-///
-/// @param annotate whether to annotate the output with debug information
-///
-/// @deprecated use write_translation_unit(ctct, tu, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_translation_unit(const translation_unit& tu,
-		       unsigned		       indent,
-		       const string&	       path,
-		       const bool	       annotate)
-{
-  bool result = true;
-
-  try
-    {
-      ofstream of(path.c_str(), std::ios_base::trunc);
-      if (!of.is_open())
-	{
-	  cerr << "failed to access " << path << "\n";
-	  return false;
-	}
-
-      write_context ctxt(tu.get_environment(), of);
-      set_annotate(ctxt, annotate);
-      if (!write_translation_unit(ctxt, tu, indent))
-	{
-	  cerr << "failed to access " << path << "\n";
-	  result = false;
-	}
-
-      of.close();
-    }
-  catch(...)
-    {
-      cerr << "failed to write to " << path << "\n";
-      result = false;
-    }
-
-  return result;
-}
-
-
 /// Serialize a pointer to an instance of basic type declaration, into
 /// an output stream.
 ///
@@ -4323,53 +4247,6 @@ write_corpus(write_context&	ctxt,
   return true;
 }
 
-/// Serialize an ABI corpus to a single native xml document.  The root
-/// node of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param ctxt the write context to use.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr& corpus, unsigned indent, write_context& ctxt)
-{
-  return write_corpus(ctxt, corpus, indent);
-}
-
-/// Serialize an ABI corpus to a single native xml document.  The root
-/// node of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param out the output stream to serialize the ABI corpus to.
-///
-/// @param annotate whether ABIXML output should be annotated.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
-	     unsigned	       indent,
-	     std::ostream&     out,
-	     const bool	       annotate)
-{
-  if (!corpus)
-    return false;
-
-  write_context ctxt(corpus->get_environment(), out);
-  set_annotate(ctxt, annotate);
-
-  return write_corpus(ctxt, corpus, indent);
-}
-
 /// Serialize an ABI corpus group to a single native xml document.
 /// The root note of the resulting XML document is 'abi-corpus-group'.
 ///
@@ -4422,108 +4299,6 @@ std::ostream& out = ctxt.get_ostream();
   return true;
 }
 
-/// Serialize an ABI corpus group to a single native xml document.
-/// The root note of the resulting XML document is 'abi-corpus-group'.
-///
-/// @param group the corpus group to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param ctxt the write context to use.
-///
-/// @deprecated use write_corpus_group(ctxt, corpus_group, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
-		   unsigned		    indent,
-		   write_context&	    ctxt)
-
-{
-  return write_corpus_group(ctxt, group, indent);
-}
-
-/// Serialize an ABI corpus group to a single native xml document.
-/// The root note of the resulting XML document is 'abi-corpus-group'.
-///
-/// @param group the corpus group to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param out the output stream to serialize the ABI corpus to.
-///
-/// @param annotate whether ABIXML output should be annotated.
-///
-/// @deprecated use write_corpus_group(ctxt, corpus_group, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus_group(const corpus_group_sptr& group,
-		   unsigned		    indent,
-		   std::ostream&	    out,
-		   const bool		    annotate)
-
-{
-  if (!group)
-    return false;
-
-  write_context ctxt(group->get_environment(), out);
-  set_annotate(ctxt, annotate);
-
-  return write_corpus_group(ctxt, group, indent);
-}
-
-/// Serialize an ABI corpus to a single native xml document.  The root
-/// note of the resulting XML document is 'abi-corpus'.
-///
-/// @param corpus the corpus to serialize.
-///
-/// @param indent the number of white space indentation to use.
-///
-/// @param path the output file to serialize the ABI corpus to.
-///
-/// @param annotate whether ABIXML output should be annotated.
-///
-/// @deprecated: use write_corpus(ctxt, corpus, indent)
-///
-/// @return true upon successful completion, false otherwise.
-bool ABG_DEPRECATED
-write_corpus(const corpus_sptr corpus,
-	     unsigned	       indent,
-	     const string&     path,
-	     const bool	       annotate)
-{
-    bool result = true;
-
-  try
-    {
-      ofstream of(path.c_str(), std::ios_base::trunc);
-      if (!of.is_open())
-	{
-	  cerr << "failed to access " << path << "\n";
-	  return false;
-	}
-
-      const write_context_sptr& ctxt
-	  = create_write_context(corpus->get_environment(), of);
-      ctxt->set_annotate(annotate);
-      if (!write_corpus(*ctxt, corpus, indent))
-	{
-	  cerr << "failed to access " << path << "\n";
-	  result = false;
-	}
-
-      of.close();
-    }
-  catch(...)
-    {
-      cerr << "failed to write to " << path << "\n";
-      result = false;
-    }
-
-  return result;
-}
-
 } //end namespace xml_writer
 
 // <Debugging routines>
-- 
2.21.0.1020.gf2820cf01a-goog