[lld] r315414 - Inline small functions.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 10 19:20:00 PDT 2017


Author: ruiu
Date: Tue Oct 10 19:20:00 2017
New Revision: 315414

URL: http://llvm.org/viewvc/llvm-project?rev=315414&view=rev
Log:
Inline small functions.

Modified:
    lld/trunk/ELF/LinkerScript.cpp
    lld/trunk/ELF/LinkerScript.h

Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=315414&r1=315413&r2=315414&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Tue Oct 10 19:20:00 2017
@@ -176,22 +176,6 @@ void LinkerScript::assignSymbol(SymbolAs
   }
 }
 
-bool SymbolAssignment::classof(const BaseCommand *C) {
-  return C->Kind == AssignmentKind;
-}
-
-bool InputSectionDescription::classof(const BaseCommand *C) {
-  return C->Kind == InputSectionKind;
-}
-
-bool AssertCommand::classof(const BaseCommand *C) {
-  return C->Kind == AssertKind;
-}
-
-bool BytesDataCommand::classof(const BaseCommand *C) {
-  return C->Kind == BytesDataKind;
-}
-
 static std::string filename(InputFile *File) {
   if (!File)
     return "";

Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=315414&r1=315413&r2=315414&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Tue Oct 10 19:20:00 2017
@@ -89,7 +89,9 @@ struct SymbolAssignment : BaseCommand {
   SymbolAssignment(StringRef Name, Expr E, std::string Loc)
       : BaseCommand(AssignmentKind), Name(Name), Expression(E), Location(Loc) {}
 
-  static bool classof(const BaseCommand *C);
+  static bool classof(const BaseCommand *C) {
+    return C->Kind == AssignmentKind;
+  }
 
   // The LHS of an expression. Name is either a symbol name or ".".
   StringRef Name;
@@ -140,7 +142,9 @@ struct InputSectionDescription : BaseCom
   InputSectionDescription(StringRef FilePattern)
       : BaseCommand(InputSectionKind), FilePat(FilePattern) {}
 
-  static bool classof(const BaseCommand *C);
+  static bool classof(const BaseCommand *C) {
+    return C->Kind == InputSectionKind;
+  }
 
   StringMatcher FilePat;
 
@@ -155,7 +159,7 @@ struct InputSectionDescription : BaseCom
 struct AssertCommand : BaseCommand {
   AssertCommand(Expr E) : BaseCommand(AssertKind), Expression(E) {}
 
-  static bool classof(const BaseCommand *C);
+  static bool classof(const BaseCommand *C) { return C->Kind == AssertKind; }
 
   Expr Expression;
 };
@@ -165,7 +169,7 @@ struct BytesDataCommand : BaseCommand {
   BytesDataCommand(Expr E, unsigned Size)
       : BaseCommand(BytesDataKind), Expression(E), Size(Size) {}
 
-  static bool classof(const BaseCommand *C);
+  static bool classof(const BaseCommand *C) { return C->Kind == BytesDataKind; }
 
   Expr Expression;
   unsigned Offset;




More information about the llvm-commits mailing list