Add capitilization and punctuation to TODO comments (#4486)

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
This commit is contained in:
josh11b
2024-11-05 16:31:00 +00:00
committed by GitHub
co-authored by Josh L
parent 9c8ca2f6e9
commit 4febf7c459
16 changed files with 29 additions and 28 deletions
+3 -2
View File
@@ -819,8 +819,9 @@ static auto CheckRequiredDefinitions(Context& context,
break;
}
case SemIR::InterfaceDecl::Kind: {
// TODO: handle `interface` as well, once we can test it without
// triggering https://github.com/carbon-language/carbon-lang/issues/4071
// TODO: Handle `interface` as well, once we can test it without
// triggering
// https://github.com/carbon-language/carbon-lang/issues/4071.
CARBON_FATAL("TODO: Support interfaces in DiagnoseMissingDefinitions");
}
case CARBON_KIND(SemIR::SpecificFunction specific_function): {
+1 -1
View File
@@ -1159,7 +1159,7 @@ auto ConvertForExplicitAs(Context& context, Parse::NodeId as_node,
{.kind = ConversionTarget::ExplicitAs, .type_id = type_id});
}
// TODO: consider moving this to pattern_match.h
// TODO: Consider moving this to pattern_match.h.
auto ConvertCallArgs(Context& context, SemIR::LocId call_loc_id,
SemIR::InstId self_id,
llvm::ArrayRef<SemIR::InstId> arg_refs,
+4 -4
View File
@@ -1310,7 +1310,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
Phase phase = Phase::Template;
SemIR::TypeId base_facet_type_id =
GetConstantValue(eval_context, info.base_facet_type_id, &phase);
// TODO: process & canonicalize requirements
// TODO: Process & canonicalize requirements.
SemIR::InstBlockId requirement_block_id = info.requirement_block_id;
// If nothing changed, can reuse this instruction.
if (base_facet_type_id == info.base_facet_type_id &&
@@ -1401,7 +1401,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
break;
case CARBON_KIND(SemIR::SymbolicBindingPattern bind): {
// TODO: disable constant evaluation of SymbolicBindingPattern once
// TODO: Disable constant evaluation of SymbolicBindingPattern once
// DeduceGenericCallArguments no longer needs implicit params to have
// constant values.
const auto& bind_name =
@@ -1457,7 +1457,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
return eval_context.GetConstantValue(typed_inst.value_id);
}
case CARBON_KIND(SemIR::ValueParamPattern param_pattern): {
// TODO: treat this as a non-expression (here and in GetExprCategory)
// TODO: Treat this as a non-expression (here and in GetExprCategory)
// once generic deduction doesn't need patterns to have constant values.
return eval_context.GetConstantValue(param_pattern.subpattern_id);
}
@@ -1485,7 +1485,7 @@ static auto TryEvalInstInContext(EvalContext& eval_context,
base_facet_type_id =
GetConstantValue(eval_context, base_facet_type_id, &phase);
SemIR::InstBlockId requirement_block_id = typed_inst.requirements_id;
// TODO: process & canonicalize requirements
// TODO: Process & canonicalize requirements.
return MakeFacetTypeResult(eval_context.context(), base_facet_type_id,
requirement_block_id, phase);
}
+2 -2
View File
@@ -243,7 +243,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
}
context.node_stack().Push(node_id, param_pattern_id);
// TODO: use the pattern insts to generate the pattern-match insts
// TODO: Use the pattern insts to generate the pattern-match insts
// at the end of the full pattern, instead of eagerly generating them
// here.
break;
@@ -285,7 +285,7 @@ auto HandleParseNode(Context& context,
if (context.decl_introducer_state_stack().innermost().kind ==
Lex::TokenKind::Let) {
// Disallow `let` outside of function and interface definitions.
// TODO: find a less brittle way of doing this. An invalid scope_inst_id
// TODO: Find a less brittle way of doing this. An invalid scope_inst_id
// can represent a block scope, but is also used for other kinds of scopes
// that aren't necessarily part of an interface or function decl.
auto scope_inst_id = context.scope_stack().PeekInstId();
+1 -1
View File
@@ -147,7 +147,7 @@ static auto HandleDecl(Context& context, NodeT node_id)
-> std::optional<DeclInfo> {
std::optional<DeclInfo> decl_info = DeclInfo();
// TODO: update binding-pattern handling to use the pattern block even in
// TODO: Update binding-pattern handling to use the pattern block even in
// a let/var context, and then consume it here.
context.pattern_block_stack().PopAndDiscard();
+3 -3
View File
@@ -78,8 +78,8 @@ auto HandleParseNode(Context& context, Parse::RequirementEqualEqualId node_id)
-> bool {
auto rhs = context.node_stack().PopExpr();
auto lhs = context.node_stack().PopExpr();
// TODO: type check lhs and rhs are comparable
// TODO: require that at least one side uses a designator
// TODO: Type check lhs and rhs are comparable.
// TODO: Require that at least one side uses a designator.
// Build up the list of arguments for the `WhereExpr` inst.
context.args_type_info_stack().AddInstId(
@@ -104,7 +104,7 @@ auto HandleParseNode(Context& context, Parse::RequirementImplsId node_id)
context.emitter().Emit(rhs_node, ImplsOnNonFacetType);
rhs_as_type.inst_id = SemIR::InstId::BuiltinError;
}
// TODO: require that at least one side uses a designator
// TODO: Require that at least one side uses a designator.
// Build up the list of arguments for the `WhereExpr` inst.
context.args_type_info_stack().AddInstId(
+3 -3
View File
@@ -46,7 +46,7 @@ enum class MatchKind {
// against the portion of the pattern below the ParamPattern insts.
Callee,
// TODO: add enumerator for non-function-call pattern match
// TODO: Add enumerator for non-function-call pattern match.
};
// The collected state of a pattern-matching operation.
@@ -115,7 +115,7 @@ class MatchContext {
SemIR::SpecificId callee_specific_id_;
// The return slot inst emitted by `DoWork`, if any.
// TODO: can this be added to the block returned by `DoWork`, instead?
// TODO: Can this be added to the block returned by `DoWork`, instead?
SemIR::InstId return_slot_id_;
};
@@ -251,7 +251,7 @@ auto MatchContext::EmitPatternMatch(Context& context,
break;
}
case MatchKind::Callee: {
// TODO: consider ways to address near-duplication with the
// TODO: Consider ways to address near-duplication with the
// ValueParamPattern case.
if (param_pattern.runtime_index ==
SemIR::RuntimeParamIndex::Unknown) {
+1 -1
View File
@@ -49,7 +49,7 @@ auto CodeGen::EmitCode(llvm::raw_pwrite_stream& out,
// Using the legacy PM to generate the assembly since the new PM
// does not work with this yet.
// TODO: make the new PM work with the codegen pipeline.
// TODO: Make the new PM work with the codegen pipeline.
llvm::legacy::PassManager pass;
// Note that this returns true on an error.
if (target_machine_->addPassesToEmitFile(pass, out, nullptr, file_type)) {
+1 -1
View File
@@ -34,7 +34,7 @@ auto DiagnosticLoc::FormatSnippet(llvm::raw_ostream& out, int indent) const
out << "^";
// We want to ensure that we don't underline past the end of the line in
// case of a multiline token.
// TODO: revisit this once we can reference multiple ranges on multiple
// TODO: Revisit this once we can reference multiple ranges on multiple
// lines in a single diagnostic message.
int underline_length =
std::min(length, static_cast<int32_t>(line.size()) - column);
+1 -1
View File
@@ -526,7 +526,7 @@ class CompilationUnit {
}
if (options_.output_filename == "-") {
// TODO: the output file name, forcing object output, and requesting
// TODO: The output file name, forcing object output, and requesting
// textual assembly output are all somewhat linked flags. We should add
// some validation that they are used correctly.
if (options_.force_obj_output) {
+1 -1
View File
@@ -81,7 +81,7 @@ auto Server::onCall(llvm::StringRef method, llvm::json::Value params,
llvm::json::Value id) -> bool {
if (auto handler = handlers_.MethodHandlers.find(method);
handler != handlers_.MethodHandlers.end()) {
// TODO: improve this if add threads
// TODO: Improve this if add threads.
handler->second(std::move(params),
[&](llvm::Expected<llvm::json::Value> reply) {
transport_->reply(id, std::move(reply));
+1 -1
View File
@@ -46,7 +46,7 @@ class Server : public clang::clangd::Transport::MessageHandler,
auto callMethod(llvm::StringRef method, llvm::json::Value params,
clang::clangd::Callback<llvm::json::Value> reply)
-> void override {
// TODO: implement when needed
// TODO: Implement when needed.
}
// Send notification to client
+1 -1
View File
@@ -355,7 +355,7 @@ auto FileContext::BuildFunctionDefinition(SemIR::FunctionId function_id)
calling_convention_param_ids.push_back(return_slot.storage_id);
}
// TODO: find a way to ensure this code and the function-call lowering use
// TODO: Find a way to ensure this code and the function-call lowering use
// the same parameter ordering.
// Lowers the given parameter. Must be called in LLVM calling convention
+2 -2
View File
@@ -294,7 +294,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory {
}
case CARBON_KIND(BindName inst): {
// TODO: don't rely on value_id for expression category, since it may
// TODO: Don't rely on value_id for expression category, since it may
// not be valid yet. This workaround only works because we don't support
// `var` in function signatures yet.
if (!inst.value_id.is_valid()) {
@@ -356,7 +356,7 @@ auto GetExprCategory(const File& file, InstId inst_id) -> ExprCategory {
return ExprCategory::EphemeralRef;
case OutParam::Kind:
// TODO: consider introducing a separate category for OutParam:
// TODO: Consider introducing a separate category for OutParam:
// unlike other DurableRefs, it permits initialization.
return ExprCategory::DurableRef;
}
+1 -1
View File
@@ -961,7 +961,7 @@ class FormatterImpl {
out_ << "<facet-type ";
FormatType(info.base_facet_type_id);
if (info.requirement_block_id.is_valid()) {
// TODO: include specifics
// TODO: Include specifics.
out_ << "+requirements";
}
out_ << ">";
+3 -3
View File
@@ -126,7 +126,7 @@ auto StringifyTypeExpr(const SemIR::File& outer_sem_ir, InstId outer_inst_id)
steps.push_back(step.Next());
FacetTypeInfo facet_type_info =
sem_ir.facet_types().Get(inst.facet_type_id);
// TODO: also output restrictions from
// TODO: Also output restrictions from
// facet_type_info.requirement_block_id.
TypeId type_id = facet_type_info.base_facet_type_id;
push_inst_id(sem_ir.types().GetInstId(type_id));
@@ -266,8 +266,8 @@ auto StringifyTypeExpr(const SemIR::File& outer_sem_ir, InstId outer_inst_id)
steps.push_back(step.Next());
TypeId type_id = sem_ir.insts().Get(inst.period_self_id).type_id();
push_inst_id(sem_ir.types().GetInstId(type_id));
// TODO: also output restrictions from the inst block
// inst.requirements_id
// TODO: Also output restrictions from the inst block
// inst.requirements_id.
} else {
out << ">";
}