mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 07:11:13 +00:00
Switch more of toolchain to enumerate/seq (#3137)
These were already used in a few spots, just trying to switch more loops for consistency and ease of reading.
This commit is contained in:
1 parent
5c2338dbd0
commit
7330e6698c
10 files changed
+39
-44
No files matched your search
@@ -5,9 +5,8 @@
|
||||
#include "toolchain/semantics/semantics_ir.h"
|
||||
|
||||
#include "common/check.h"
|
||||
#include "llvm/ADT/DenseSet.h"
|
||||
#include "llvm/ADT/Sequence.h"
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/Support/SaveAndRestore.h"
|
||||
#include "toolchain/base/pretty_stack_trace_function.h"
|
||||
#include "toolchain/parser/parse_tree_node_location_translator.h"
|
||||
#include "toolchain/semantics/semantics_builtin_kind.h"
|
||||
@@ -52,7 +51,7 @@ auto SemanticsIR::MakeFromParseTree(const SemanticsIR& builtin_ir,
|
||||
// Copy builtins over.
|
||||
semantics_ir.nodes_.resize_for_overwrite(SemanticsBuiltinKind::ValidCount);
|
||||
static constexpr auto BuiltinIR = SemanticsCrossReferenceIRId(0);
|
||||
for (int i = 0; i < SemanticsBuiltinKind::ValidCount; ++i) {
|
||||
for (int i : llvm::seq(SemanticsBuiltinKind::ValidCount)) {
|
||||
// We can reuse the type node ID because the offsets of cross-references
|
||||
// will be the same in this IR.
|
||||
auto type = builtin_ir.nodes_[i].type_id();
|
||||
|
||||
Reference in new issue
Block a user