[Lldb-commits] [lldb] r278000 - Remove Android.h

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 8 05:54:37 PDT 2016


Author: labath
Date: Mon Aug  8 07:54:36 2016
New Revision: 278000

URL: http://llvm.org/viewvc/llvm-project?rev=278000&view=rev
Log:
Remove Android.h

It only contained a reimplementation of std::to_string, which I have replaced with usages of
pre-existing llvm::to_string (also, injecting members into the std namespace is evil).

Removed:
    lldb/trunk/include/lldb/Host/android/Android.h
Modified:
    lldb/trunk/include/lldb/lldb-private.h
    lldb/trunk/source/Host/common/HostInfoBase.cpp
    lldb/trunk/source/Host/linux/Host.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    lldb/trunk/source/Utility/PseudoTerminal.cpp
    lldb/trunk/tools/lldb-server/Acceptor.cpp

Removed: lldb/trunk/include/lldb/Host/android/Android.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/android/Android.h?rev=277999&view=auto
==============================================================================
--- lldb/trunk/include/lldb/Host/android/Android.h (original)
+++ lldb/trunk/include/lldb/Host/android/Android.h (removed)
@@ -1,28 +0,0 @@
-//===-- lldb-android.h --------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLDB_lldb_android_h_
-#define LLDB_lldb_android_h_
-
-#include <sstream>
-#include <string>
-#include <errno.h>
-
-namespace std
-{
-	template <typename T>
-	std::string to_string(T value)
-	{
-		std::ostringstream os ;
-		os << value ;
-		return os.str() ;
-	}
-}
-
-#endif  // LLDB_lldb_android_h_

Modified: lldb/trunk/include/lldb/lldb-private.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private.h?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private.h (original)
+++ lldb/trunk/include/lldb/lldb-private.h Mon Aug  8 07:54:36 2016
@@ -16,10 +16,6 @@
 #include "lldb/Host/windows/win32.h"
 #endif
 
-#ifdef __ANDROID_NDK__
-#include "lldb/Host/android/Android.h"
-#endif
-
 #include "lldb/lldb-public.h"
 #include "lldb/lldb-private-enumerations.h"
 #include "lldb/lldb-private-interfaces.h"

Modified: lldb/trunk/source/Host/common/HostInfoBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostInfoBase.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/HostInfoBase.cpp (original)
+++ lldb/trunk/source/Host/common/HostInfoBase.cpp Mon Aug  8 07:54:36 2016
@@ -17,10 +17,11 @@
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/HostInfoBase.h"
 
-#include "llvm/ADT/Triple.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/ScopedPrinter.h"
 #include "llvm/Support/raw_ostream.h"
 
 #include <thread>
@@ -334,7 +335,7 @@ HostInfoBase::ComputeProcessTempFileDire
     if (!HostInfo::ComputeGlobalTempFileDirectory(temp_file_spec))
         return false;
 
-    std::string pid_str{std::to_string(Host::GetCurrentProcessID())};
+    std::string pid_str{llvm::to_string(Host::GetCurrentProcessID())};
     temp_file_spec.AppendPathComponent(pid_str);
     if (!FileSystem::MakeDirectory(temp_file_spec, eFilePermissionsDirectoryDefault).Success())
         return false;

Modified: lldb/trunk/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/Host.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/Host.cpp (original)
+++ lldb/trunk/source/Host/linux/Host.cpp Mon Aug  8 07:54:36 2016
@@ -19,6 +19,7 @@
 
 // C++ Includes
 // Other libraries and framework includes
+#include "llvm/Support/ScopedPrinter.h"
 // Project includes
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Log.h"
@@ -26,9 +27,6 @@
 
 #include "lldb/Host/Host.h"
 #include "lldb/Host/HostInfo.h"
-#ifdef __ANDROID_NDK__
-#include "lldb/Host/android/Android.h"
-#endif
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/DataExtractor.h"
 
@@ -236,7 +234,7 @@ Host::FindProcessThreads (const lldb::pi
     bool tids_changed = false;
     static const char procdir[] = "/proc/";
     static const char taskdir[] = "/task/";
-    std::string process_task_dir = procdir + std::to_string(pid) + taskdir;
+    std::string process_task_dir = procdir + llvm::to_string(pid) + taskdir;
     DIR *dirproc = opendir (process_task_dir.c_str());
 
     if (dirproc)

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Mon Aug  8 07:54:36 2016
@@ -33,6 +33,7 @@
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Support/ScopedPrinter.h"
 
 // Project includes
 #include "ProcessGDBRemoteLog.h"
@@ -1250,7 +1251,7 @@ GDBRemoteCommunication::StartDebugserver
                 }
                 int write_fd = socket_pipe.GetWriteFileDescriptor();
                 debugserver_args.AppendArgument("--pipe");
-                debugserver_args.AppendArgument(std::to_string(write_fd).c_str());
+                debugserver_args.AppendArgument(llvm::to_string(write_fd).c_str());
                 launch_info.AppendCloseFileAction(socket_pipe.GetReadFileDescriptor());
 #endif
             }

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Mon Aug  8 07:54:36 2016
@@ -21,8 +21,6 @@
 #include <thread>
 
 // Other libraries and framework includes
-#include "llvm/ADT/Triple.h"
-#include "lldb/Interpreter/Args.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/RegisterValue.h"
@@ -37,13 +35,16 @@
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/StringConvert.h"
 #include "lldb/Host/TimeValue.h"
-#include "lldb/Target/FileAction.h"
-#include "lldb/Target/MemoryRegionInfo.h"
-#include "lldb/Host/common/NativeRegisterContext.h"
 #include "lldb/Host/common/NativeProcessProtocol.h"
+#include "lldb/Host/common/NativeRegisterContext.h"
 #include "lldb/Host/common/NativeThreadProtocol.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Target/FileAction.h"
+#include "lldb/Target/MemoryRegionInfo.h"
 #include "lldb/Utility/JSON.h"
 #include "lldb/Utility/LLDBAssert.h"
+#include "llvm/ADT/Triple.h"
+#include "llvm/Support/ScopedPrinter.h"
 
 // Project includes
 #include "Utility/StringExtractorGDBRemote.h"
@@ -490,8 +491,7 @@ GetRegistersAsJSON(NativeThreadProtocol
         StreamString stream;
         WriteRegisterValueInHexFixedWidth(stream, reg_ctx_sp, *reg_info_p, &reg_value);
 
-        register_object_sp->SetObject(std::to_string(reg_num),
-                std::make_shared<JSONString>(stream.GetString()));
+        register_object_sp->SetObject(llvm::to_string(reg_num), std::make_shared<JSONString>(stream.GetString()));
     }
 
     return register_object_sp;

Modified: lldb/trunk/source/Utility/PseudoTerminal.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/PseudoTerminal.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/source/Utility/PseudoTerminal.cpp (original)
+++ lldb/trunk/source/Utility/PseudoTerminal.cpp Mon Aug  8 07:54:36 2016
@@ -33,7 +33,6 @@ char *ptsname(int fd) { return 0; }
 pid_t fork(void) { return 0; }
 pid_t setsid(void) { return 0; }
 #elif defined(__ANDROID_NDK__)
-#include "lldb/Host/android/Android.h"
 int posix_openpt(int flags);
 #endif
 

Modified: lldb/trunk/tools/lldb-server/Acceptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/Acceptor.cpp?rev=278000&r1=277999&r2=278000&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/Acceptor.cpp (original)
+++ lldb/trunk/tools/lldb-server/Acceptor.cpp Mon Aug  8 07:54:36 2016
@@ -10,6 +10,7 @@
 #include "Acceptor.h"
 
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ScopedPrinter.h"
 
 #include "lldb/Core/StreamString.h"
 #include "lldb/Host/ConnectionFileDescriptor.h"
@@ -142,7 +143,7 @@ Acceptor::Create(StringRef name, const b
             TCPSocket* tcp_socket = static_cast<TCPSocket*>(listener_socket_up.get());
             local_socket_id = [tcp_socket]() {
                 auto local_port = tcp_socket->GetLocalPortNumber();
-                return (local_port != 0) ? std::to_string(local_port) : "";
+                return (local_port != 0) ? llvm::to_string(local_port) : "";
             };
         }
         else




More information about the lldb-commits mailing list