[lld] r262444 - Remove default implementations that are always overridden by subclasses.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 17:34:34 PST 2016


Author: ruiu
Date: Tue Mar  1 19:34:34 2016
New Revision: 262444

URL: http://llvm.org/viewvc/llvm-project?rev=262444&view=rev
Log:
Remove default implementations that are always overridden by subclasses.

Modified:
    lld/trunk/include/lld/Core/LinkingContext.h
    lld/trunk/lib/Core/LinkingContext.cpp

Modified: lld/trunk/include/lld/Core/LinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/LinkingContext.h?rev=262444&r1=262443&r2=262444&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/LinkingContext.h (original)
+++ lld/trunk/include/lld/Core/LinkingContext.h Tue Mar  1 19:34:34 2016
@@ -200,9 +200,7 @@ public:
   bool validate(raw_ostream &diagnostics);
 
   /// Formats symbol name for use in error messages.
-  virtual std::string demangle(StringRef symbolName) const {
-    return symbolName;
-  }
+  virtual std::string demangle(StringRef symbolName) const = 0;
 
   /// @}
   /// \name Methods used by Driver::link()
@@ -234,11 +232,11 @@ public:
   /// This method is called by core linking to give the Writer a chance
   /// to add file format specific "files" to set of files to be linked. This is
   /// how file format specific atoms can be added to the link.
-  virtual void createImplicitFiles(std::vector<std::unique_ptr<File>> &);
+  virtual void createImplicitFiles(std::vector<std::unique_ptr<File>> &) = 0;
 
   /// This method is called by core linking to build the list of Passes to be
   /// run on the merged/linked graph of all input files.
-  virtual void addPasses(PassManager &pm);
+  virtual void addPasses(PassManager &pm) = 0;
 
   /// Calls through to the writeFile() method on the specified Writer.
   ///
@@ -250,16 +248,14 @@ public:
 
   // This function is called just before the Resolver kicks in.
   // Derived classes may use it to change the list of input files.
-  virtual void finalizeInputFiles() {}
+  virtual void finalizeInputFiles() = 0;
 
   /// Callback invoked for each file the Resolver decides we are going to load.
   /// This can be used to update context state based on the file, and emit
   /// errors for any differences between the context state and a loaded file.
   /// For example, we can error if we try to load a file which is a different
   /// arch from that being linked.
-  virtual std::error_code handleLoadedFile(File &file) {
-    return std::error_code();
-  }
+  virtual std::error_code handleLoadedFile(File &file) = 0;
 
   /// @}
 protected:

Modified: lld/trunk/lib/Core/LinkingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Core/LinkingContext.cpp?rev=262444&r1=262443&r2=262444&view=diff
==============================================================================
--- lld/trunk/lib/Core/LinkingContext.cpp (original)
+++ lld/trunk/lib/Core/LinkingContext.cpp Tue Mar  1 19:34:34 2016
@@ -33,11 +33,6 @@ std::error_code LinkingContext::writeFil
   return this->writer().writeFile(linkedFile, _outputPath);
 }
 
-void LinkingContext::createImplicitFiles(
-    std::vector<std::unique_ptr<File>> &result) {
-  this->writer().createImplicitFiles(result);
-}
-
 std::unique_ptr<File> LinkingContext::createEntrySymbolFile() const {
   return createEntrySymbolFile("<command line option -e>");
 }
@@ -77,6 +72,4 @@ void LinkingContext::createInternalFiles
     result.push_back(std::move(file));
 }
 
-void LinkingContext::addPasses(PassManager &pm) {}
-
 } // end namespace lld




More information about the llvm-commits mailing list