[PATCH] D100867: [TableGen] [docs] Improve description of NAME in Programmer's Reference

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 17:03:18 PDT 2021


dblaikie added inline comments.


================
Comment at: llvm/docs/TableGen/ProgRef.rst:65-66
 the programmer or generated by TableGen. Associated with that name
-is a list of *fields* with values and an optional list of *superclasses*
-(sometimes called base or parent classes). The fields are the primary data that
+is a list of *fields* with values and an optional list of *parent classes*
+(sometimes called base or super classes). The fields are the primary data that
 backends will process. Note that TableGen assigns no meanings to fields; the
----------------
Paul-C-Anagnostopoulos wrote:
> dblaikie wrote:
> > Paul-C-Anagnostopoulos wrote:
> > > dblaikie wrote:
> > > > Not sure how the wording is used in other parts of the TableGen docs, but since LLVM's a C++ oriented project, maybe we should standardize/lean towards the C++ terminology as being the canonical one, which would be "base" class?
> > > Here we are talking about a record inheriting from a class. I can't find any standard name for that class. Is "base class" the standard? As far as I can tell, "base," "parent," and "super" all pertain to the class hierarchy.
> > In the C++ standard "base" is the term that's used - that's visible also in the C++ API with type traits like std::is_base_of ( https://en.cppreference.com/w/cpp/types/is_base_of )
> std::is_base_of() takes two classes. Here we need a term for the class that a record inherits from, not a term involving the class hierarchy. In C++ we would be talking about an instance's class, for which the term is just "class." But we don't think of records as instances.
> 
> I suppose "base class" is just as good as "parent class" and would be the correct term when we are talking about one class inheriting from another class. Okay, let me reword the text with "base class" as the primary term.
> Here we need a term for the class that a record inherits from,

Hmm, OK - maybe there isn't a good analogy with C++, then. 

What if the wording here said "an optional list of classes" (rather than base/parent/super)? I guess that doesn't apply to all the other places.

I guess: How'd you pick parent rather than super or base (but not completely consistently)? Were there more uses of parent than any other, so you decided to standardize on that name?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100867/new/

https://reviews.llvm.org/D100867



More information about the llvm-commits mailing list