diff options
author | Rui Ueyama <ruiu@google.com> | 2017-10-11 02:20:00 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-10-11 02:20:00 +0000 |
commit | a80633ca145d52623739c955a43f095c04e588fb (patch) | |
tree | 7d75722aa8795afc46aed5b022665e0dfbd01349 | |
parent | b4f1b88551092e5e838d08fe06dff325a06837ae (diff) | |
download | bcm5719-llvm-a80633ca145d52623739c955a43f095c04e588fb.tar.gz bcm5719-llvm-a80633ca145d52623739c955a43f095c04e588fb.zip |
Inline small functions.
llvm-svn: 315414
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 16 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.h | 12 |
2 files changed, 8 insertions, 20 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d7123d94881..579f2f8cfa8 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -176,22 +176,6 @@ void LinkerScript::assignSymbol(SymbolAssignment *Cmd, bool InSec) { } } -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 ""; diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 065042e942e..aec93050f88 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -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 : BaseCommand { 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 : BaseCommand { 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; |