Remove deprecated APIs. Bump SONAME accordingly.

Change-Id: I4dfdb9bf9dfa68d029f6f8908acf61e39cc5373d
Reviewed-on: https://code-review.googlesource.com/c/re2/+/54570
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/Makefile b/Makefile
index fd9cec6..a550717 100644
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,7 @@
 
 # ABI version
 # http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
-SONAME=6
+SONAME=7
 
 # To rebuild the Tables generated by Perl and Python scripts (requires Internet
 # access for Unicode data), uncomment the following line:
diff --git a/re2/re2.cc b/re2/re2.cc
index a1b42f5..d231a21 100644
--- a/re2/re2.cc
+++ b/re2/re2.cc
@@ -344,36 +344,6 @@
   return Fanout(prog, histogram);
 }
 
-static int Fanout(Prog* prog, std::map<int, int>* histogram) {
-  SparseArray<int> fanout(prog->size());
-  prog->Fanout(&fanout);
-  histogram->clear();
-  for (SparseArray<int>::iterator i = fanout.begin(); i != fanout.end(); ++i) {
-    if (i->value() == 0)
-      continue;
-    uint32_t value = i->value();
-    int bucket = FindMSBSet(value);
-    bucket += value & (value-1) ? 1 : 0;
-    ++(*histogram)[bucket];
-  }
-  return histogram->rbegin()->first;
-}
-
-int RE2::ProgramFanout(std::map<int, int>* histogram) const {
-  if (prog_ == NULL)
-    return -1;
-  return Fanout(prog_, histogram);
-}
-
-int RE2::ReverseProgramFanout(std::map<int, int>* histogram) const {
-  if (prog_ == NULL)
-    return -1;
-  Prog* prog = ReverseProg();
-  if (prog == NULL)
-    return -1;
-  return Fanout(prog, histogram);
-}
-
 // Returns named_groups_, computing it if needed.
 const std::map<std::string, int>& RE2::NamedCapturingGroups() const {
   std::call_once(named_groups_once_, [](const RE2* re) {
diff --git a/re2/re2.h b/re2/re2.h
index 6c65500..8dee246 100644
--- a/re2/re2.h
+++ b/re2/re2.h
@@ -298,12 +298,6 @@
   int ProgramFanout(std::vector<int>* histogram) const;
   int ReverseProgramFanout(std::vector<int>* histogram) const;
 
-  // DEPRECATED! WILL BE REMOVED!
-  // Outputs the program fanout as a histogram bucketed by powers of 2.
-  // Returns the number of the largest non-empty bucket.
-  int ProgramFanout(std::map<int, int>* histogram) const;
-  int ReverseProgramFanout(std::map<int, int>* histogram) const;
-
   // Returns the underlying Regexp; not for general use.
   // Returns entire_regexp_ so that callers don't need
   // to know about prefix_ and prefix_foldcase_.
@@ -637,16 +631,6 @@
     Encoding encoding() const { return encoding_; }
     void set_encoding(Encoding encoding) { encoding_ = encoding; }
 
-    // DEPRECATED! WILL BE REMOVED!
-    bool utf8() const { return encoding_ == EncodingUTF8; }
-    void set_utf8(bool b) {
-      if (b) {
-        encoding_ = EncodingUTF8;
-      } else {
-        encoding_ = EncodingLatin1;
-      }
-    }
-
     bool posix_syntax() const { return posix_syntax_; }
     void set_posix_syntax(bool b) { posix_syntax_ = b; }