Move pod_array.h and sparse_{array,set}.h from util/ to re2/.

Change-Id: I1dcfbdd4546891108cf25a3397c0aa5cc1c07192
Reviewed-on: https://code-review.googlesource.com/c/re2/+/46510
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/BUILD b/BUILD
index f3191b9..1e1c753 100644
--- a/BUILD
+++ b/BUILD
@@ -38,6 +38,7 @@
         "re2/onepass.cc",
         "re2/parse.cc",
         "re2/perl_groups.cc",
+        "re2/pod_array.h",
         "re2/prefilter.cc",
         "re2/prefilter.h",
         "re2/prefilter_tree.cc",
@@ -49,6 +50,8 @@
         "re2/regexp.h",
         "re2/set.cc",
         "re2/simplify.cc",
+        "re2/sparse_array.h",
+        "re2/sparse_set.h",
         "re2/stringpiece.cc",
         "re2/tostring.cc",
         "re2/unicode_casefold.cc",
@@ -60,10 +63,7 @@
         "util/logging.h",
         "util/mix.h",
         "util/mutex.h",
-        "util/pod_array.h",
         "util/rune.cc",
-        "util/sparse_array.h",
-        "util/sparse_set.h",
         "util/strutil.cc",
         "util/strutil.h",
         "util/utf.h",
diff --git a/Makefile b/Makefile
index 3571611..0db70ad 100644
--- a/Makefile
+++ b/Makefile
@@ -83,21 +83,21 @@
 	util/mix.h\
 	util/mutex.h\
 	util/pcre.h\
-	util/pod_array.h\
-	util/sparse_array.h\
-	util/sparse_set.h\
 	util/strutil.h\
 	util/test.h\
 	util/utf.h\
 	util/util.h\
 	re2/bitmap256.h\
 	re2/filtered_re2.h\
+	re2/pod_array.h\
 	re2/prefilter.h\
 	re2/prefilter_tree.h\
 	re2/prog.h\
 	re2/re2.h\
 	re2/regexp.h\
 	re2/set.h\
+	re2/sparse_array.h\
+	re2/sparse_set.h\
 	re2/stringpiece.h\
 	re2/testing/exhaustive_tester.h\
 	re2/testing/regexp_generator.h\
diff --git a/re2/bitstate.cc b/re2/bitstate.cc
index 317b26f..5cbc070 100644
--- a/re2/bitstate.cc
+++ b/re2/bitstate.cc
@@ -24,7 +24,7 @@
 #include <utility>
 
 #include "util/logging.h"
-#include "util/pod_array.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
 #include "re2/regexp.h"
 
diff --git a/re2/compile.cc b/re2/compile.cc
index 7457b22..7848dfc 100644
--- a/re2/compile.cc
+++ b/re2/compile.cc
@@ -14,8 +14,8 @@
 #include <utility>
 
 #include "util/logging.h"
-#include "util/pod_array.h"
 #include "util/utf.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
 #include "re2/regexp.h"
diff --git a/re2/dfa.cc b/re2/dfa.cc
index f0d342a..8631a2f 100644
--- a/re2/dfa.cc
+++ b/re2/dfa.cc
@@ -39,10 +39,10 @@
 #include "util/logging.h"
 #include "util/mix.h"
 #include "util/mutex.h"
-#include "util/pod_array.h"
-#include "util/sparse_set.h"
 #include "util/strutil.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
+#include "re2/sparse_set.h"
 #include "re2/stringpiece.h"
 
 // Silence "zero-sized array in struct/union" warning for DFA::State::next_.
diff --git a/re2/nfa.cc b/re2/nfa.cc
index e16831e..48e7119 100644
--- a/re2/nfa.cc
+++ b/re2/nfa.cc
@@ -31,13 +31,13 @@
 #include <utility>
 #include <vector>
 
+#include "util/logging.h"
+#include "util/strutil.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
 #include "re2/regexp.h"
-#include "util/logging.h"
-#include "util/pod_array.h"
-#include "util/sparse_array.h"
-#include "util/sparse_set.h"
-#include "util/strutil.h"
+#include "re2/sparse_array.h"
+#include "re2/sparse_set.h"
 
 namespace re2 {
 
diff --git a/re2/onepass.cc b/re2/onepass.cc
index 7a774ce..1b3f374 100644
--- a/re2/onepass.cc
+++ b/re2/onepass.cc
@@ -59,11 +59,11 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/pod_array.h"
-#include "util/sparse_set.h"
 #include "util/strutil.h"
 #include "util/utf.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
+#include "re2/sparse_set.h"
 #include "re2/stringpiece.h"
 
 // Silence "zero-sized array in struct/union" warning for OneState::action.
diff --git a/re2/parse.cc b/re2/parse.cc
index 03b53c7..11f8b3b 100644
--- a/re2/parse.cc
+++ b/re2/parse.cc
@@ -27,9 +27,9 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/pod_array.h"
 #include "util/strutil.h"
 #include "util/utf.h"
+#include "re2/pod_array.h"
 #include "re2/regexp.h"
 #include "re2/stringpiece.h"
 #include "re2/unicode_casefold.h"
diff --git a/util/pod_array.h b/re2/pod_array.h
similarity index 91%
rename from util/pod_array.h
rename to re2/pod_array.h
index eaf492d..e8093ad 100644
--- a/util/pod_array.h
+++ b/re2/pod_array.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#ifndef UTIL_POD_ARRAY_H_
-#define UTIL_POD_ARRAY_H_
+#ifndef RE2_POD_ARRAY_H_
+#define RE2_POD_ARRAY_H_
 
 #include <memory>
 #include <type_traits>
@@ -52,4 +52,4 @@
 
 }  // namespace re2
 
-#endif  // UTIL_POD_ARRAY_H_
+#endif  // RE2_POD_ARRAY_H_
diff --git a/re2/prefilter_tree.h b/re2/prefilter_tree.h
index b2e2d74..5d73074 100644
--- a/re2/prefilter_tree.h
+++ b/re2/prefilter_tree.h
@@ -21,8 +21,8 @@
 #include <vector>
 
 #include "util/util.h"
-#include "util/sparse_array.h"
 #include "re2/prefilter.h"
+#include "re2/sparse_array.h"
 
 namespace re2 {
 
diff --git a/re2/prog.h b/re2/prog.h
index bacc411..40a6ce4 100644
--- a/re2/prog.h
+++ b/re2/prog.h
@@ -18,10 +18,10 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/pod_array.h"
-#include "util/sparse_array.h"
-#include "util/sparse_set.h"
+#include "re2/pod_array.h"
 #include "re2/re2.h"
+#include "re2/sparse_array.h"
+#include "re2/sparse_set.h"
 
 namespace re2 {
 
diff --git a/re2/re2.cc b/re2/re2.cc
index ef02d82..5156fe5 100644
--- a/re2/re2.cc
+++ b/re2/re2.cc
@@ -24,11 +24,11 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/sparse_array.h"
 #include "util/strutil.h"
 #include "util/utf.h"
 #include "re2/prog.h"
 #include "re2/regexp.h"
+#include "re2/sparse_array.h"
 
 namespace re2 {
 
diff --git a/re2/set.cc b/re2/set.cc
index d4c34ad..69af666 100644
--- a/re2/set.cc
+++ b/re2/set.cc
@@ -10,11 +10,11 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/pod_array.h"
-#include "re2/stringpiece.h"
+#include "re2/pod_array.h"
 #include "re2/prog.h"
 #include "re2/re2.h"
 #include "re2/regexp.h"
+#include "re2/stringpiece.h"
 
 namespace re2 {
 
diff --git a/re2/simplify.cc b/re2/simplify.cc
index 8939678..c6eb4a7 100644
--- a/re2/simplify.cc
+++ b/re2/simplify.cc
@@ -10,8 +10,8 @@
 
 #include "util/util.h"
 #include "util/logging.h"
-#include "util/pod_array.h"
 #include "util/utf.h"
+#include "re2/pod_array.h"
 #include "re2/regexp.h"
 #include "re2/walker-inl.h"
 
diff --git a/util/sparse_array.h b/re2/sparse_array.h
similarity index 98%
rename from util/sparse_array.h
rename to re2/sparse_array.h
index c81c9f3..09ffe08 100644
--- a/util/sparse_array.h
+++ b/re2/sparse_array.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#ifndef UTIL_SPARSE_ARRAY_H_
-#define UTIL_SPARSE_ARRAY_H_
+#ifndef RE2_SPARSE_ARRAY_H_
+#define RE2_SPARSE_ARRAY_H_
 
 // DESCRIPTION
 //
@@ -102,7 +102,7 @@
 #include <memory>
 #include <utility>
 
-#include "util/pod_array.h"
+#include "re2/pod_array.h"
 
 namespace re2 {
 
@@ -389,4 +389,4 @@
 
 }  // namespace re2
 
-#endif  // UTIL_SPARSE_ARRAY_H_
+#endif  // RE2_SPARSE_ARRAY_H_
diff --git a/util/sparse_set.h b/re2/sparse_set.h
similarity index 97%
rename from util/sparse_set.h
rename to re2/sparse_set.h
index 0d5ad51..06ed88d 100644
--- a/util/sparse_set.h
+++ b/re2/sparse_set.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#ifndef UTIL_SPARSE_SET_H_
-#define UTIL_SPARSE_SET_H_
+#ifndef RE2_SPARSE_SET_H_
+#define RE2_SPARSE_SET_H_
 
 // DESCRIPTION
 //
@@ -61,7 +61,7 @@
 #include <memory>
 #include <utility>
 
-#include "util/pod_array.h"
+#include "re2/pod_array.h"
 
 namespace re2 {
 
@@ -261,4 +261,4 @@
 
 }  // namespace re2
 
-#endif  // UTIL_SPARSE_SET_H_
+#endif  // RE2_SPARSE_SET_H_