Move stringpiece.h and stringprintf.h to base/.

Change-Id: I7f71b4a12f99c5f81771146c66629ae5a947b229
diff --git a/build/Android.common.mk b/build/Android.common.mk
index 03d403f..9bc7541 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -132,6 +132,8 @@
 	src/atomic.cc.arm \
 	src/base/logging.cc \
 	src/base/mutex.cc \
+	src/base/stringpiece.cc \
+	src/base/stringprintf.cc \
 	src/base/unix_file/fd_file.cc \
 	src/base/unix_file/mapped_file.cc \
 	src/base/unix_file/null_file.cc \
@@ -227,8 +229,6 @@
 	src/runtime_support.cc \
 	src/signal_catcher.cc \
 	src/stack.cc \
-	src/stringpiece.cc \
-	src/stringprintf.cc \
 	src/thread.cc \
 	src/thread_list.cc \
 	src/thread_pool.cc \
diff --git a/src/atomic.cc b/src/atomic.cc
index 480e456..5bbbb4f 100644
--- a/src/atomic.cc
+++ b/src/atomic.cc
@@ -17,11 +17,12 @@
 #include "atomic.h"
 
 #include <pthread.h>
+
 #include <vector>
 
 #include "base/mutex.h"
 #include "base/stl_util.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "thread.h"
 
 #if defined(__APPLE__)
diff --git a/src/base/logging_android.cc b/src/base/logging_android.cc
index 0acf5f9..9b1ac58 100644
--- a/src/base/logging_android.cc
+++ b/src/base/logging_android.cc
@@ -15,11 +15,12 @@
  */
 
 #include "logging.h"
-#include "stringprintf.h"
 
-#include <iostream>
 #include <unistd.h>
 
+#include <iostream>
+
+#include "base/stringprintf.h"
 #include "cutils/log.h"
 
 namespace art {
diff --git a/src/base/logging_linux.cc b/src/base/logging_linux.cc
index 789c083..0399128 100644
--- a/src/base/logging_linux.cc
+++ b/src/base/logging_linux.cc
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "logging.h"
+
 #include <sys/types.h>
 #include <unistd.h>
 
@@ -21,8 +23,7 @@
 #include <cstring>
 #include <iostream>
 
-#include "logging.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "utils.h"
 
 namespace art {
diff --git a/src/stringpiece.cc b/src/base/stringpiece.cc
similarity index 100%
rename from src/stringpiece.cc
rename to src/base/stringpiece.cc
diff --git a/src/stringpiece.h b/src/base/stringpiece.h
similarity index 98%
rename from src/stringpiece.h
rename to src/base/stringpiece.h
index 7ff826d..193f5f7 100644
--- a/src/stringpiece.h
+++ b/src/base/stringpiece.h
@@ -25,8 +25,8 @@
 // Systematic usage of StringPiece is encouraged as it will reduce unnecessary
 // conversions from "const char*" to "string" and back again.
 
-#ifndef ART_SRC_STRINGPIECE_H_
-#define ART_SRC_STRINGPIECE_H_
+#ifndef ART_SRC_BASE_STRINGPIECE_H_
+#define ART_SRC_BASE_STRINGPIECE_H_
 
 #include <string.h>
 #include <algorithm>
@@ -219,4 +219,4 @@
 
 }  // namespace art
 
-#endif  // ART_SRC_STRINGPIECE_H_
+#endif  // ART_SRC_BASE_STRINGPIECE_H_
diff --git a/src/stringprintf.cc b/src/base/stringprintf.cc
similarity index 100%
rename from src/stringprintf.cc
rename to src/base/stringprintf.cc
diff --git a/src/stringprintf.h b/src/base/stringprintf.h
similarity index 90%
rename from src/stringprintf.h
rename to src/base/stringprintf.h
index 21eb465..d707cc0 100644
--- a/src/stringprintf.h
+++ b/src/base/stringprintf.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef STRINGPRINTF_H_
-#define STRINGPRINTF_H_
+#ifndef ART_SRC_BASE_STRINGPRINTF_H_
+#define ART_SRC_BASE_STRINGPRINTF_H_
 
 #include <stdarg.h>
 #include <string>
@@ -35,4 +35,4 @@
 
 }  // namespace art
 
-#endif  // STRINGPRINTF_H_
+#endif  // ART_SRC_BASE_STRINGPRINTF_H_
diff --git a/src/base/unix_file/string_file.h b/src/base/unix_file/string_file.h
index 4277dc2..8944373 100644
--- a/src/base/unix_file/string_file.h
+++ b/src/base/unix_file/string_file.h
@@ -22,8 +22,8 @@
 #include <string>
 
 #include "base/macros.h"
+#include "base/stringpiece.h"
 #include "base/unix_file/random_access_file.h"
-#include "stringpiece.h"
 
 namespace unix_file {
 
diff --git a/src/common_test.h b/src/common_test.h
index 60f665a..2836706 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -23,6 +23,7 @@
 #include "../../external/icu4c/common/unicode/uvernum.h"
 #include "base/macros.h"
 #include "base/stl_util.h"
+#include "base/stringprintf.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "class_loader.h"
@@ -35,9 +36,8 @@
 #include "object_utils.h"
 #include "os.h"
 #include "runtime.h"
-#include "ScopedLocalRef.h"
 #include "scoped_thread_state_change.h"
-#include "stringprintf.h"
+#include "ScopedLocalRef.h"
 #include "thread.h"
 #include "UniquePtr.h"
 #include "well_known_classes.h"
diff --git a/src/compiler_llvm/ir_builder.cc b/src/compiler_llvm/ir_builder.cc
index e8e73e3..51a8170 100644
--- a/src/compiler_llvm/ir_builder.cc
+++ b/src/compiler_llvm/ir_builder.cc
@@ -15,7 +15,8 @@
  */
 
 #include "ir_builder.h"
-#include "stringprintf.h"
+
+#include "base/stringprintf.h"
 
 #include <llvm/Module.h>
 
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 52fb02c..ccec7e9 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -19,6 +19,7 @@
 #include "backend_types.h"
 #include "base/logging.h"
 #include "base/stl_util.h"
+#include "base/stringprintf.h"
 #include "compilation_unit.h"
 #include "compiler.h"
 #include "dalvik_reg.h"
@@ -29,7 +30,6 @@
 #include "object_utils.h"
 #include "runtime_support_func.h"
 #include "runtime_support_llvm.h"
-#include "stringprintf.h"
 #include "utils_llvm.h"
 #include "verifier/method_verifier.h"
 
diff --git a/src/compiler_llvm/runtime_support_builder_x86.cc b/src/compiler_llvm/runtime_support_builder_x86.cc
index cf38594..0eb38af 100644
--- a/src/compiler_llvm/runtime_support_builder_x86.cc
+++ b/src/compiler_llvm/runtime_support_builder_x86.cc
@@ -16,8 +16,8 @@
 
 #include "runtime_support_builder_x86.h"
 
+#include "base/stringprintf.h"
 #include "ir_builder.h"
-#include "stringprintf.h"
 #include "thread.h"
 #include "utils_llvm.h"
 
diff --git a/src/compiler_llvm/utils_llvm.h b/src/compiler_llvm/utils_llvm.h
index 5ad68d0..cec21dc 100644
--- a/src/compiler_llvm/utils_llvm.h
+++ b/src/compiler_llvm/utils_llvm.h
@@ -17,7 +17,7 @@
 #ifndef ART_SRC_UTILS_LLVM_H_
 #define ART_SRC_UTILS_LLVM_H_
 
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 
 #include <llvm/Analysis/Verifier.h>
 
diff --git a/src/dex2oat.cc b/src/dex2oat.cc
index 70b2a6b..e434c29 100644
--- a/src/dex2oat.cc
+++ b/src/dex2oat.cc
@@ -24,6 +24,7 @@
 #include <vector>
 
 #include "base/stl_util.h"
+#include "base/stringpiece.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "class_loader.h"
@@ -37,7 +38,6 @@
 #include "ScopedLocalRef.h"
 #include "scoped_thread_state_change.h"
 #include "sirt_ref.h"
-#include "stringpiece.h"
 #include "timing_logger.h"
 #include "well_known_classes.h"
 #include "zip_archive.h"
diff --git a/src/dex_file.cc b/src/dex_file.cc
index 83912b9..7398616 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -25,6 +25,7 @@
 #include <sys/stat.h>
 
 #include "base/logging.h"
+#include "base/stringprintf.h"
 #include "class_linker.h"
 #include "dex_file_verifier.h"
 #include "globals.h"
@@ -32,7 +33,6 @@
 #include "object.h"
 #include "os.h"
 #include "safe_map.h"
-#include "stringprintf.h"
 #include "thread.h"
 #include "UniquePtr.h"
 #include "utf.h"
diff --git a/src/dex_file.h b/src/dex_file.h
index 194ce8a..184d950 100644
--- a/src/dex_file.h
+++ b/src/dex_file.h
@@ -21,13 +21,13 @@
 #include <vector>
 
 #include "base/logging.h"
+#include "base/stringpiece.h"
 #include "globals.h"
 #include "invoke_type.h"
 #include "jni.h"
 #include "mem_map.h"
 #include "modifiers.h"
 #include "safe_map.h"
-#include "stringpiece.h"
 #include "UniquePtr.h"
 #include "utils.h"
 
diff --git a/src/dex_file_verifier.cc b/src/dex_file_verifier.cc
index b8df696..83ef31a 100644
--- a/src/dex_file_verifier.cc
+++ b/src/dex_file_verifier.cc
@@ -16,10 +16,10 @@
 
 #include "dex_file_verifier.h"
 
+#include "base/stringprintf.h"
 #include "leb128.h"
 #include "object.h"
 #include "safe_map.h"
-#include "stringprintf.h"
 #include "UniquePtr.h"
 #include "zip_archive.h"
 
diff --git a/src/disassembler_arm.cc b/src/disassembler_arm.cc
index c3bcc9f..ea7a216 100644
--- a/src/disassembler_arm.cc
+++ b/src/disassembler_arm.cc
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "base/logging.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/disassembler_mips.cc b/src/disassembler_mips.cc
index 6f0cdd4..a281796 100644
--- a/src/disassembler_mips.cc
+++ b/src/disassembler_mips.cc
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "base/logging.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/disassembler_x86.cc b/src/disassembler_x86.cc
index 8dbc7c1..38171f6 100644
--- a/src/disassembler_x86.cc
+++ b/src/disassembler_x86.cc
@@ -19,7 +19,7 @@
 #include <iostream>
 
 #include "base/logging.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "thread.h"
 
 namespace art {
diff --git a/src/hprof/hprof.cc b/src/hprof/hprof.cc
index 8777986..c0e73bc 100644
--- a/src/hprof/hprof.cc
+++ b/src/hprof/hprof.cc
@@ -38,6 +38,7 @@
 #include <set>
 
 #include "base/logging.h"
+#include "base/stringprintf.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "debugger.h"
@@ -49,7 +50,6 @@
 #include "safe_map.h"
 #include "scoped_thread_state_change.h"
 #include "gc/space.h"
-#include "stringprintf.h"
 #include "thread_list.h"
 
 namespace art {
diff --git a/src/jdwp/jdwp_adb.cc b/src/jdwp/jdwp_adb.cc
index 5cf8f3f..27f9aaa 100644
--- a/src/jdwp/jdwp_adb.cc
+++ b/src/jdwp/jdwp_adb.cc
@@ -21,9 +21,9 @@
 #include <unistd.h>
 
 #include "base/logging.h"
+#include "base/stringprintf.h"
 #include "jdwp/jdwp_handler.h"
 #include "jdwp/jdwp_priv.h"
-#include "stringprintf.h"
 
 #ifdef HAVE_ANDROID_OS
 #include "cutils/sockets.h"
diff --git a/src/jdwp/jdwp_event.cc b/src/jdwp/jdwp_event.cc
index 20d7cde..8b3964a 100644
--- a/src/jdwp/jdwp_event.cc
+++ b/src/jdwp/jdwp_event.cc
@@ -22,12 +22,12 @@
 #include <unistd.h>
 
 #include "base/logging.h"
+#include "base/stringprintf.h"
 #include "debugger.h"
 #include "jdwp/jdwp_constants.h"
 #include "jdwp/jdwp_expand_buf.h"
 #include "jdwp/jdwp_handler.h"
 #include "jdwp/jdwp_priv.h"
-#include "stringprintf.h"
 
 /*
 General notes:
diff --git a/src/jdwp/jdwp_handler.cc b/src/jdwp/jdwp_handler.cc
index c243ae2..cf5b722 100644
--- a/src/jdwp/jdwp_handler.cc
+++ b/src/jdwp/jdwp_handler.cc
@@ -34,12 +34,12 @@
 #include "atomic.h"
 #include "base/logging.h"
 #include "base/macros.h"
+#include "base/stringprintf.h"
 #include "debugger.h"
 #include "jdwp/jdwp_constants.h"
 #include "jdwp/jdwp_event.h"
 #include "jdwp/jdwp_expand_buf.h"
 #include "jdwp/jdwp_priv.h"
-#include "stringprintf.h"
 
 namespace art {
 
diff --git a/src/jdwp/jdwp_socket.cc b/src/jdwp/jdwp_socket.cc
index 604ba83..eb1506c 100644
--- a/src/jdwp/jdwp_socket.cc
+++ b/src/jdwp/jdwp_socket.cc
@@ -27,9 +27,9 @@
 #include <unistd.h>
 
 #include "base/logging.h"
+#include "base/stringprintf.h"
 #include "jdwp/jdwp_handler.h"
 #include "jdwp/jdwp_priv.h"
-#include "stringprintf.h"
 
 #define kBasePort           8000
 #define kMaxPort            8040
diff --git a/src/jni_internal.cc b/src/jni_internal.cc
index fc7bdd4..6e40cf4 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -25,6 +25,7 @@
 #include "base/logging.h"
 #include "base/mutex.h"
 #include "base/stl_util.h"
+#include "base/stringpiece.h"
 #include "class_linker.h"
 #include "class_loader.h"
 #include "invoke_arg_array_builder.h"
@@ -35,7 +36,6 @@
 #include "safe_map.h"
 #include "scoped_thread_state_change.h"
 #include "ScopedLocalRef.h"
-#include "stringpiece.h"
 #include "thread.h"
 #include "UniquePtr.h"
 #include "well_known_classes.h"
diff --git a/src/mem_map.cc b/src/mem_map.cc
index f322773..800f274 100644
--- a/src/mem_map.cc
+++ b/src/mem_map.cc
@@ -16,12 +16,12 @@
 
 #include "mem_map.h"
 
-#include "ScopedFd.h"
-#include "stringprintf.h"
-#include "utils.h"
-
 #include <corkscrew/map_info.h>
 
+#include "base/stringprintf.h"
+#include "ScopedFd.h"
+#include "utils.h"
+
 #define USE_ASHMEM 1
 
 #ifdef USE_ASHMEM
diff --git a/src/oatdump.cc b/src/oatdump.cc
index a24a1bf..cac89fd 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -22,6 +22,7 @@
 #include <string>
 #include <vector>
 
+#include "base/stringpiece.h"
 #include "base/unix_file/fd_file.h"
 #include "class_linker.h"
 #include "dex_instruction.h"
@@ -36,7 +37,6 @@
 #include "runtime.h"
 #include "safe_map.h"
 #include "scoped_thread_state_change.h"
-#include "stringpiece.h"
 #include "verifier/method_verifier.h"
 
 namespace art {
diff --git a/src/object.h b/src/object.h
index 2ae3ac1..ecd086b 100644
--- a/src/object.h
+++ b/src/object.h
@@ -20,11 +20,11 @@
 #include <iosfwd>
 #include <vector>
 
-#include "UniquePtr.h"
 #include "atomic.h"
 #include "base/casts.h"
 #include "base/logging.h"
 #include "base/macros.h"
+#include "base/stringpiece.h"
 #include "globals.h"
 #include "heap.h"
 #include "invoke_type.h"
@@ -32,8 +32,8 @@
 #include "offsets.h"
 #include "primitive.h"
 #include "runtime.h"
-#include "stringpiece.h"
 #include "thread.h"
+#include "UniquePtr.h"
 #include "utf.h"
 
 namespace art {
diff --git a/src/runtime.h b/src/runtime.h
index c8a520a..84cc826 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -26,6 +26,7 @@
 #include <vector>
 
 #include "base/macros.h"
+#include "base/stringpiece.h"
 #include "globals.h"
 #include "heap.h"
 #include "instruction_set.h"
@@ -33,7 +34,6 @@
 #include "locks.h"
 #include "runtime_stats.h"
 #include "safe_map.h"
-#include "stringpiece.h"
 
 #if defined(ART_USE_LLVM_COMPILER)
 #include "compiler_llvm/procedure_linkage_table.h"
diff --git a/src/runtime_linux.cc b/src/runtime_linux.cc
index 862a066..0be6339 100644
--- a/src/runtime_linux.cc
+++ b/src/runtime_linux.cc
@@ -22,7 +22,7 @@
 
 #include "base/logging.h"
 #include "base/mutex.h"
-#include "stringprintf.h"
+#include "base/stringprintf.h"
 #include "thread.h"
 #include "utils.h"
 
diff --git a/src/utils.h b/src/utils.h
index b73693c..40f0768 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -17,16 +17,17 @@
 #ifndef ART_SRC_UTILS_H_
 #define ART_SRC_UTILS_H_
 
-#include "base/logging.h"
-#include "globals.h"
-#include "primitive.h"
-#include "stringpiece.h"
-#include "stringprintf.h"
-
 #include <pthread.h>
+
 #include <string>
 #include <vector>
 
+#include "base/logging.h"
+#include "base/stringpiece.h"
+#include "base/stringprintf.h"
+#include "globals.h"
+#include "primitive.h"
+
 namespace art {
 
 class Class;
diff --git a/src/verifier/method_verifier.cc b/src/verifier/method_verifier.cc
index d98b9b9..41098cb 100644
--- a/src/verifier/method_verifier.cc
+++ b/src/verifier/method_verifier.cc
@@ -19,19 +19,19 @@
 #include <iostream>
 
 #include "base/logging.h"
+#include "base/stringpiece.h"
 #include "class_linker.h"
 #include "compiler.h"
 #include "dex_cache.h"
 #include "dex_file.h"
 #include "dex_instruction.h"
 #include "dex_instruction_visitor.h"
-#include "verifier/dex_gc_map.h"
 #include "indenter.h"
 #include "intern_table.h"
 #include "leb128.h"
 #include "object_utils.h"
 #include "runtime.h"
-#include "stringpiece.h"
+#include "verifier/dex_gc_map.h"
 
 #if defined(ART_USE_LLVM_COMPILER)
 #include "greenland/backend_types.h"
diff --git a/src/zip_archive.h b/src/zip_archive.h
index cee33da..54835cf 100644
--- a/src/zip_archive.h
+++ b/src/zip_archive.h
@@ -21,12 +21,12 @@
 #include <zlib.h>
 
 #include "base/logging.h"
+#include "base/stringpiece.h"
 #include "base/unix_file/random_access_file.h"
 #include "globals.h"
 #include "mem_map.h"
 #include "os.h"
 #include "safe_map.h"
-#include "stringpiece.h"
 #include "UniquePtr.h"
 
 namespace art {