[PATCH] Pedantically rename all Tool subclasses to be nouns, not verbs. NFC

Douglas Katzman dougk at google.com
Sun Jun 21 19:17:09 PDT 2015


Classes in Tools.h inherit ultimately from Tool, possibly via GnuTool.
The problem: "Assemble", "Compile", etc are verbs, whereas "Tool" is a noun (and "Link" is both, but in this context, a verb).
Had the classes been named for their command-line (literally `ld`, etc), this would be rational in that ld is a tool per se.
But they're not- they're named by the conceptual tool's operation.

With the patch, a constructor call - formerly "Compile(args...)" - loses the deceptive appearance of doing that at the time of call and is more symmetric with the factory invocation, e.g. BuildLinker() returns a "new namespace::Linker(...)", not "new namespace::Link(...)".
 
Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names. And there is no particulary great way to name the "Lipo-er" and a few others.

http://reviews.llvm.org/D10595

Files:
  lib/Driver/CrossWindowsToolChain.cpp
  lib/Driver/MSVCToolChain.cpp
  lib/Driver/ToolChains.cpp
  lib/Driver/ToolChains.h
  lib/Driver/Tools.cpp
  lib/Driver/Tools.h

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10595.28093.patch
Type: text/x-patch
Size: 66604 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150622/dae0910d/attachment.bin>


More information about the cfe-commits mailing list