clang-tidy pass on executable_semantics (#963)

This commit is contained in:
Jon Meow
2021-12-02 12:21:18 -08:00
committed by GitHub
parent d09822905e
commit 92903afbd5
12 changed files with 28 additions and 30 deletions
+1 -1
View File
@@ -209,7 +209,7 @@ class StatementAction : public Action {
// with AST nodes.
class ScopeAction : public Action {
public:
ScopeAction(Scope scope) : Action(Kind::ScopeAction) {
explicit ScopeAction(Scope scope) : Action(Kind::ScopeAction) {
StartScope(std::move(scope));
}
+1 -1
View File
@@ -36,7 +36,7 @@ class AllocationId {
// details of Heap.
friend class Heap;
AllocationId(size_t index) : index_(index) {}
explicit AllocationId(size_t index) : index_(index) {}
size_t index_;
};
@@ -113,8 +113,7 @@ void PopulateNamesInStatement(Arena* arena,
// Populates names for a member. See PopulateNamesInDeclaration for overall
// flow.
void PopulateNamesInMember(Arena* arena, const Member& member,
StaticScope& static_scope) {
void PopulateNamesInMember(const Member& member, StaticScope& static_scope) {
switch (member.kind()) {
case MemberKind::FieldMember: {
const auto& field = cast<FieldMember>(member);
@@ -148,7 +147,7 @@ void PopulateNamesInDeclaration(Arena* arena, Declaration& declaration,
class_decl.static_scope().AddParent(&static_scope);
static_scope.Add(class_decl.name(), &declaration);
for (auto* member : class_decl.members()) {
PopulateNamesInMember(arena, *member, class_decl.static_scope());
PopulateNamesInMember(*member, class_decl.static_scope());
}
break;
}
+2 -2
View File
@@ -117,7 +117,7 @@ class IntValue : public Value {
// A function value.
class FunctionValue : public Value {
public:
FunctionValue(Nonnull<const FunctionDeclaration*> declaration)
explicit FunctionValue(Nonnull<const FunctionDeclaration*> declaration)
: Value(Kind::FunctionValue), declaration_(declaration) {}
static auto classof(const Value* value) -> bool {
@@ -495,7 +495,7 @@ class ContinuationValue : public Value {
~StackFragment();
StackFragment(StackFragment&&) = delete;
StackFragment& operator=(StackFragment&&) = delete;
auto operator=(StackFragment&&) -> StackFragment& = delete;
// Store the given partial todo stack in *this, which must currently be
// empty. The stack is represented with the top of the stack at the