[lld] r357193 - Make a member function a non-member function.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 10:35:00 PDT 2019


Author: ruiu
Date: Thu Mar 28 10:35:00 2019
New Revision: 357193

URL: http://llvm.org/viewvc/llvm-project?rev=357193&view=rev
Log:
Make a member function a non-member function.

Since this member function doesn't use anything in the class,
it doesn't have to be a member of the class.

Modified:
    lld/trunk/ELF/Arch/X86_64.cpp

Modified: lld/trunk/ELF/Arch/X86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Arch/X86_64.cpp?rev=357193&r1=357192&r2=357193&view=diff
==============================================================================
--- lld/trunk/ELF/Arch/X86_64.cpp (original)
+++ lld/trunk/ELF/Arch/X86_64.cpp Thu Mar 28 10:35:00 2019
@@ -45,10 +45,6 @@ public:
   void relaxTlsLdToLe(uint8_t *Loc, RelType Type, uint64_t Val) const override;
   bool adjustPrologueForCrossSplitStack(uint8_t *Loc, uint8_t *End,
                                         uint8_t StOther) const override;
-
-private:
-  void relaxGotNoPic(uint8_t *Loc, uint64_t Val, uint8_t Op,
-                     uint8_t ModRm) const;
 };
 } // namespace
 
@@ -393,8 +389,8 @@ RelExpr X86_64::adjustRelaxExpr(RelType
 // "Intel 64 and IA-32 Architectures Software Developer's Manual V2"
 // (http://www.intel.com/content/dam/www/public/us/en/documents/manuals/
 //    64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf)
-void X86_64::relaxGotNoPic(uint8_t *Loc, uint64_t Val, uint8_t Op,
-                           uint8_t ModRm) const {
+static void relaxGotNoPic(uint8_t *Loc, uint64_t Val, uint8_t Op,
+                          uint8_t ModRm) {
   const uint8_t Rex = Loc[-3];
   // Convert "test %reg, foo at GOTPCREL(%rip)" to "test $foo, %reg".
   if (Op == 0x85) {




More information about the llvm-commits mailing list