abg-writer: drop deprecated API
authorMatthias Maennich <maennich@google.com>
Tue, 21 May 2019 04:39:23 +0000 (05:39 +0100)
committerDodji Seketeli <dodji@redhat.com>
Wed, 22 May 2019 12:33:45 +0000 (14:33 +0200)
Drop the deprecated overloads for write_translation_unit, write_corpus,
write_corpus_group. Also remove the deprecation facilities as they are
not used anymore.

* include/abg-fwd.h (ABG_DEPRECATED): Remove this macro.
* include/abg-writer.h (write_translation_unit, write_corpus)
(write_corpus_group): Drop the deprecated overloads of these
declarations.
* src/abg-writer.cc (write_translation_unit, write_corpus)
(write_corpus_group): Drop the deprecated overloads of these
definitions.

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-fwd.h
include/abg-writer.h
src/abg-writer.cc

index e925800..ddec06d 100644 (file)
@@ -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__
index a2904d7..ef887b7 100644 (file)
@@ -94,18 +94,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,
@@ -125,43 +113,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
 
index 1b923c5..2c9085b 100644 (file)
@@ -2058,82 +2058,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.
 ///
@@ -4313,53 +4237,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'.
 ///
@@ -4412,108 +4289,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>