[lld] r248197 - COFF: Rename A.replaceWith(B) -> B.replace(A). NFC.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 12:36:51 PDT 2015


Author: ruiu
Date: Mon Sep 21 14:36:51 2015
New Revision: 248197

URL: http://llvm.org/viewvc/llvm-project?rev=248197&view=rev
Log:
COFF: Rename A.replaceWith(B) -> B.replace(A). NFC.

Modified:
    lld/trunk/COFF/Chunks.cpp
    lld/trunk/COFF/Chunks.h
    lld/trunk/COFF/ICF.cpp

Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=248197&r1=248196&r2=248197&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Mon Sep 21 14:36:51 2015
@@ -228,9 +228,9 @@ ArrayRef<uint8_t> SectionChunk::getConte
   return A;
 }
 
-void SectionChunk::replaceWith(SectionChunk *Other) {
-  Ptr = Other->Ptr;
-  Live = false;
+void SectionChunk::replace(SectionChunk *Other) {
+  Other->Ptr = Ptr;
+  Other->Live = false;
 }
 
 CommonChunk::CommonChunk(const COFFSymbolRef S) : Sym(S) {

Modified: lld/trunk/COFF/Chunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.h?rev=248197&r1=248196&r2=248197&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.h (original)
+++ lld/trunk/COFF/Chunks.h Mon Sep 21 14:36:51 2015
@@ -201,7 +201,7 @@ private:
   bool Live;
 
   // Used for ICF (Identical COMDAT Folding)
-  void replaceWith(SectionChunk *Other);
+  void replace(SectionChunk *Other);
   std::atomic<uint64_t> GroupID = { 0 };
 
   // Chunks are basically unnamed chunks of bytes.

Modified: lld/trunk/COFF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/ICF.cpp?rev=248197&r1=248196&r2=248197&view=diff
==============================================================================
--- lld/trunk/COFF/ICF.cpp (original)
+++ lld/trunk/COFF/ICF.cpp Mon Sep 21 14:36:51 2015
@@ -247,7 +247,7 @@ void ICF::run(const std::vector<Chunk *>
         SectionChunk *SC = *It++;
         if (Config->Verbose)
           llvm::outs() << "  Removed " << SC->getDebugName() << "\n";
-        SC->replaceWith(Head);
+        Head->replace(SC);
       }
     }
   }




More information about the llvm-commits mailing list