aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-03-04 11:06:59 +0000
committergingerBill <bill@gingerbill.org>2018-03-04 11:06:59 +0000
commit105de7705a797e397b4cb8900f2c1f771684e2db (patch)
tree0896312734dd6d39ece0e191839595489b2ff725 /src/ir.cpp
parent584dffea1420b1e2ce98922f8dd5cf63e5fb8872 (diff)
Add `unselector_expr`
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 74f51d727..211834519 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -4164,11 +4164,8 @@ irValue *ir_build_builtin_proc(irProcedure *proc, AstNode *expr, TypeAndValue tv
String procedure = proc->entity->token.string;
TokenPos pos = ast_node_token(ce->proc).pos;
if (ce->args.count > 0) {
- AstNode *ident = ce->args[0];;
-
- while (ident->kind == AstNode_SelectorExpr) {
- ident = ident->SelectorExpr.selector;
- }
+ AstNode *ident = unselector_expr(ce->args[0]);
+ GB_ASSERT(ident->kind == AstNode_Ident);
Entity *e = entity_of_ident(proc->module->info, ident);
GB_ASSERT(e != nullptr);