Re-apply r245635, "[InstCombine] Transform A & (L - 1) u< L --> L != 0"
[oota-llvm.git] / tools / lli / RemoteTargetExternal.h
index b332b19c0b56345a4005950cc1ca7b9164346243..afe8570ff49fbf90c279f070ef3aa1681061eb96 100644 (file)
@@ -12,8 +12,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLI_REMOTETARGETEXTERNAL_H
-#define LLI_REMOTETARGETEXTERNAL_H
+#ifndef LLVM_TOOLS_LLI_REMOTETARGETEXTERNAL_H
+#define LLVM_TOOLS_LLI_REMOTETARGETEXTERNAL_H
 
 #include "RPCChannel.h"
 #include "RemoteTarget.h"
@@ -32,24 +32,10 @@ class RemoteTargetExternal : public RemoteTarget {
   RPCChannel RPC;
 
   bool WriteBytes(const void *Data, size_t Size) {
-    int rc = RPC.WriteBytes(Data, Size);
-    if (rc != -1 && (size_t)rc == Size)
-      return true;
-
-    ErrorMsg = "WriteBytes: ";
-    RPC.ReportError(rc, Size, ErrorMsg);
-    return false;
+    return RPC.WriteBytes(Data, Size);
   }
 
-  bool ReadBytes(void *Data, size_t Size) {
-    int rc = RPC.ReadBytes(Data, Size);
-    if (rc != -1 && (size_t)rc == Size)
-      return true;
-
-    ErrorMsg = "ReadBytes: ";
-    RPC.ReportError(rc, Size, ErrorMsg);
-    return false;
-  }
+  bool ReadBytes(void *Data, size_t Size) { return RPC.ReadBytes(Data, Size); }
 
 public:
   /// Allocate space in the remote target address space.
@@ -60,9 +46,8 @@ public:
   ///
   /// @returns True on success. On failure, ErrorMsg is updated with
   ///          descriptive text of the encountered error.
-  virtual bool allocateSpace(size_t Size,
-                             unsigned Alignment,
-                             uint64_t &Address);
+  bool allocateSpace(size_t Size, unsigned Alignment,
+                     uint64_t &Address) override;
 
   /// Load data into the target address space.
   ///
@@ -72,7 +57,7 @@ public:
   ///
   /// @returns True on success. On failure, ErrorMsg is updated with
   ///          descriptive text of the encountered error.
-  virtual bool loadData(uint64_t Address, const void *Data, size_t Size);
+  bool loadData(uint64_t Address, const void *Data, size_t Size) override;
 
   /// Load code into the target address space and prepare it for execution.
   ///
@@ -82,7 +67,7 @@ public:
   ///
   /// @returns True on success. On failure, ErrorMsg is updated with
   ///          descriptive text of the encountered error.
-  virtual bool loadCode(uint64_t Address, const void *Data, size_t Size);
+  bool loadCode(uint64_t Address, const void *Data, size_t Size) override;
 
   /// Execute code in the target process. The called function is required
   /// to be of signature int "(*)(void)".
@@ -93,16 +78,16 @@ public:
   ///
   /// @returns True on success. On failure, ErrorMsg is updated with
   ///          descriptive text of the encountered error.
-  virtual bool executeCode(uint64_t Address, int &RetVal);
+  bool executeCode(uint64_t Address, int &RetVal) override;
 
-  /// Minimum alignment for memory permissions. Used to seperate code and
+  /// Minimum alignment for memory permissions. Used to separate code and
   /// data regions to make sure data doesn't get marked as code or vice
   /// versa.
   ///
   /// @returns Page alignment return value. Default of 4k.
-  virtual unsigned getPageAlignment() { return 4096; }
+  unsigned getPageAlignment() override { return 4096; }
 
-  virtual bool create() {
+  bool create() override {
     RPC.ChildName = ChildName;
     if (!RPC.createServer())
       return true;
@@ -118,10 +103,10 @@ public:
   }
 
   /// Terminate the remote process.
-  virtual void stop();
+  void stop() override;
 
   RemoteTargetExternal(std::string &Name) : RemoteTarget(), ChildName(Name) {}
-  virtual ~RemoteTargetExternal() {}
+  ~RemoteTargetExternal() override {}
 
 private:
   std::string ChildName;
@@ -155,4 +140,4 @@ private:
 
 } // end namespace llvm
 
-#endif // LLI_REMOTETARGETEXTERNAL_H
+#endif