Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
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();
Comment Actions
It's worth noting that accessors in the base APIs don't follow this rule. Should we refactor them as well?
I'd say yes.
In this patch?
Up to you.