<div dir="ltr">Nice cleanup. Thanks Dave!<div><br></div><div>- Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 14, 2016 at 3:33 PM, David Blaikie via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Thu Jan 14 17:33:43 2016<br>
New Revision: 257840<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257840&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=257840&view=rev</a><br>
Log:<br>
Orc: Simplify some things with NSDMIs and some braced init.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h<br>
    llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h<br>
<br>
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h?rev=257840&r1=257839&r2=257840&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h?rev=257840&r1=257839&r2=257840&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h (original)<br>
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetClient.h Thu Jan 14 17:33:43 2016<br>
@@ -276,8 +276,7 @@ public:<br>
     class Alloc {<br>
     public:<br>
       Alloc(uint64_t Size, unsigned Align)<br>
-          : Size(Size), Align(Align), Contents(new char[Size + Align - 1]),<br>
-            RemoteAddr(0) {}<br>
+          : Size(Size), Align(Align), Contents(new char[Size + Align - 1]) {}<br>
<br>
       Alloc(Alloc &&Other)<br>
           : Size(std::move(Other.Size)), Align(std::move(Other.Align)),<br>
@@ -312,12 +311,11 @@ public:<br>
       uint64_t Size;<br>
       unsigned Align;<br>
       std::unique_ptr<char[]> Contents;<br>
-      TargetAddress RemoteAddr;<br>
+      TargetAddress RemoteAddr = 0;<br>
     };<br>
<br>
     struct ObjectAllocs {<br>
-      ObjectAllocs()<br>
-          : RemoteCodeAddr(0), RemoteRODataAddr(0), RemoteRWDataAddr(0) {}<br>
+      ObjectAllocs() = default;<br>
<br>
       ObjectAllocs(ObjectAllocs &&Other)<br>
           : RemoteCodeAddr(std::move(Other.RemoteCodeAddr)),<br>
@@ -337,9 +335,9 @@ public:<br>
         return *this;<br>
       }<br>
<br>
-      TargetAddress RemoteCodeAddr;<br>
-      TargetAddress RemoteRODataAddr;<br>
-      TargetAddress RemoteRWDataAddr;<br>
+      TargetAddress RemoteCodeAddr = 0;<br>
+      TargetAddress RemoteRODataAddr = 0;<br>
+      TargetAddress RemoteRWDataAddr = 0;<br>
       std::vector<Alloc> CodeAllocs, RODataAllocs, RWDataAllocs;<br>
     };<br>
<br>
@@ -410,9 +408,6 @@ public:<br>
<br>
   private:<br>
     struct RemoteIndirectStubsInfo {<br>
-      RemoteIndirectStubsInfo(TargetAddress StubBase, TargetAddress PtrBase,<br>
-                              unsigned NumStubs)<br>
-          : StubBase(StubBase), PtrBase(PtrBase), NumStubs(NumStubs) {}<br>
       TargetAddress StubBase;<br>
       TargetAddress PtrBase;<br>
       unsigned NumStubs;<br>
@@ -438,8 +433,7 @@ public:<br>
                                NewStubsRequired);<br>
<br>
       unsigned NewBlockId = RemoteIndirectStubsInfos.size();<br>
-      RemoteIndirectStubsInfos.push_back(<br>
-          RemoteIndirectStubsInfo(StubBase, PtrBase, NumStubsEmitted));<br>
+      RemoteIndirectStubsInfos.push_back({StubBase, PtrBase, NumStubsEmitted});<br>
<br>
       for (unsigned I = 0; I < NumStubsEmitted; ++I)<br>
         FreeStubs.push_back(std::make_pair(NewBlockId, I));<br>
@@ -627,8 +621,7 @@ public:<br>
<br>
 private:<br>
   OrcRemoteTargetClient(ChannelT &Channel, std::error_code &EC)<br>
-      : Channel(Channel), RemotePointerSize(0), RemotePageSize(0),<br>
-        RemoteTrampolineSize(0), RemoteIndirectStubSize(0) {<br>
+      : Channel(Channel) {<br>
     if ((EC = call<GetRemoteInfo>(Channel)))<br>
       return;<br>
<br>
@@ -790,10 +783,10 @@ private:<br>
   ChannelT &Channel;<br>
   std::error_code ExistingError;<br>
   std::string RemoteTargetTriple;<br>
-  uint32_t RemotePointerSize;<br>
-  uint32_t RemotePageSize;<br>
-  uint32_t RemoteTrampolineSize;<br>
-  uint32_t RemoteIndirectStubSize;<br>
+  uint32_t RemotePointerSize = 0;<br>
+  uint32_t RemotePageSize = 0;<br>
+  uint32_t RemoteTrampolineSize = 0;<br>
+  uint32_t RemoteIndirectStubSize = 0;<br>
   ResourceIdMgr AllocatorIds, IndirectStubOwnerIds;<br>
   std::function<TargetAddress(TargetAddress)> CompileCallback;<br>
 };<br>
<br>
Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h?rev=257840&r1=257839&r2=257840&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h?rev=257840&r1=257839&r2=257840&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h (original)<br>
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h Thu Jan 14 17:33:43 2016<br>
@@ -29,7 +29,6 @@ protected:<br>
   class ResourceIdMgr {<br>
   public:<br>
     typedef uint64_t ResourceId;<br>
-    ResourceIdMgr() : NextId(0) {}<br>
     ResourceId getNext() {<br>
       if (!FreeIds.empty()) {<br>
         ResourceId I = FreeIds.back();<br>
@@ -41,7 +40,7 @@ protected:<br>
     void release(ResourceId I) { FreeIds.push_back(I); }<br>
<br>
   private:<br>
-    ResourceId NextId;<br>
+    ResourceId NextId = 0;<br>
     std::vector<ResourceId> FreeIds;<br>
   };<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>