mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
clang-tidy pass on executable_semantics (#963)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user