[PATCH] [lld] Remove redundant classof functions.

Joey Gouly joey.gouly at gmail.com
Thu Dec 19 13:41:02 PST 2013


These are just inherited from the base classes, so are redundant!

Okay to commit?

http://llvm-reviews.chandlerc.com/D2447

Files:
  include/lld/Driver/CoreInputGraph.h
  include/lld/Driver/DarwinInputGraph.h
  include/lld/Driver/GnuLdInputGraph.h
  include/lld/Driver/WinLinkInputGraph.h

Index: include/lld/Driver/CoreInputGraph.h
===================================================================
--- include/lld/Driver/CoreInputGraph.h
+++ include/lld/Driver/CoreInputGraph.h
@@ -30,10 +30,6 @@
   COREFileNode(CoreLinkingContext &ctx, StringRef path)
       : FileNode(path), _ctx(ctx) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::File;
-  }
-
   /// \brief validates the Input Element
   virtual bool validate() {
     (void)_ctx;
Index: include/lld/Driver/DarwinInputGraph.h
===================================================================
--- include/lld/Driver/DarwinInputGraph.h
+++ include/lld/Driver/DarwinInputGraph.h
@@ -30,10 +30,6 @@
   MachOFileNode(MachOLinkingContext &ctx, StringRef path, bool isWholeArchive)
       : FileNode(path), _ctx(ctx), _isWholeArchive(isWholeArchive) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::File;
-  }
-
   /// \brief validates the Input Element
   virtual bool validate() {
     (void)_ctx;
Index: include/lld/Driver/GnuLdInputGraph.h
===================================================================
--- include/lld/Driver/GnuLdInputGraph.h
+++ include/lld/Driver/GnuLdInputGraph.h
@@ -35,10 +35,6 @@
         _isWholeArchive(isWholeArchive), _asNeeded(asNeeded),
         _isDashlPrefix(dashlPrefix) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::File;
-  }
-
   virtual ErrorOr<StringRef> getPath(const LinkingContext &ctx) const;
 
   /// \brief validates the Input Element
@@ -104,10 +100,6 @@
   ELFGroup(const ELFLinkingContext &ctx, int64_t ordinal)
       : Group(ordinal), _elfLinkingContext(ctx) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::Control;
-  }
-
   /// \brief Validate the options
   virtual bool validate() {
     (void)_elfLinkingContext;
@@ -137,10 +129,6 @@
         _linkerScript(nullptr)
   {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::File;
-  }
-
   /// \brief Is this node part of resolution ?
   virtual bool isHidden() const { return true; }
 
Index: include/lld/Driver/WinLinkInputGraph.h
===================================================================
--- include/lld/Driver/WinLinkInputGraph.h
+++ include/lld/Driver/WinLinkInputGraph.h
@@ -31,10 +31,6 @@
   PECOFFFileNode(PECOFFLinkingContext &ctx, StringRef path)
       : FileNode(path), _ctx(ctx) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::File;
-  }
-
   virtual ErrorOr<StringRef> getPath(const LinkingContext &ctx) const;
 
   /// \brief Parse the input file to lld::File.
@@ -66,10 +62,6 @@
 public:
   PECOFFGroup() : Group(0) {}
 
-  static inline bool classof(const InputElement *a) {
-    return a->kind() == InputElement::Kind::Control;
-  }
-
   virtual bool validate() { return true; }
   virtual bool dump(raw_ostream &) { return true; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2447.1.patch
Type: text/x-patch
Size: 3076 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131219/a6a717ca/attachment.bin>


More information about the llvm-commits mailing list