[PATCH] D86679: [SyntaxTree][NFC] Append "get" to syntax Nodes accessor names

Eduardo Caldas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 22:49:33 PDT 2020


eduucaldas added a reviewer: gribozavr2.
eduucaldas added a comment.

It's worth noting that accessors in the base APIs don't follow this rule. Should we refactor them as well? In this patch?
Examples:

  class Arena {
  public:
    const SourceManager &sourceManager() const { return SourceMgr; }
    const LangOptions &langOptions() const { return LangOpts; }
    const TokenBuffer &tokenBuffer() const;
    std::pair<FileID, ArrayRef<Token>>
    lexBuffer(std::unique_ptr<llvm::MemoryBuffer> Buffer);

  class Node {
  public:
    NodeKind kind() const { return static_cast<NodeKind>(Kind); }
    NodeRole role() const { return static_cast<NodeRole>(Role); }
    Tree *parent() { return Parent; }
    Node *nextSibling() { return NextSibling; }



  class Leaf final : public Node {
  public:
    const Token *token() const { return Tok; }
  };

  class Tree : public Node {
  public:
    Node *firstChild() { return FirstChild; }
    Leaf *firstLeaf();
    Leaf *lastLeaf();


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86679



More information about the cfe-commits mailing list