aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/analysis
diff options
context:
space:
mode:
authorPhilip Herron <herron.philip@googlemail.com>2020-05-20 17:54:47 +0100
committerPhilip Herron <philip.herron@embecosm.com>2020-11-28 21:13:14 +0000
commit2c6cb7e543ffa19b80ab9daf78bb1b9af8061c05 (patch)
treeba4c1b78b9c8eee419f2f67f04c08f891c61ffc6 /gcc/rust/analysis
parent1acf8eba36b06ab816866821542d189935ba360e (diff)
downloadgcc-2c6cb7e543ffa19b80ab9daf78bb1b9af8061c05.zip
gcc-2c6cb7e543ffa19b80ab9daf78bb1b9af8061c05.tar.gz
gcc-2c6cb7e543ffa19b80ab9daf78bb1b9af8061c05.tar.bz2
Add the referenced function to the CallExpr when resolved
Diffstat (limited to 'gcc/rust/analysis')
-rw-r--r--gcc/rust/analysis/rust-type-resolution.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/analysis/rust-type-resolution.cc b/gcc/rust/analysis/rust-type-resolution.cc
index 0045420..48ea699 100644
--- a/gcc/rust/analysis/rust-type-resolution.cc
+++ b/gcc/rust/analysis/rust-type-resolution.cc
@@ -439,11 +439,13 @@ TypeResolution::visit (AST::EnumExprFieldless &expr)
void
TypeResolution::visit (AST::CallExpr &expr)
{
+ // this look up should probably be moved to name resolution
auto fndecl = lookupFndecl (expr.function.get ());
if (fndecl == NULL)
return;
typeBuffer.push_back (fndecl->return_type.get ());
+ expr.fndeclRef = fndecl;
auto before = typeBuffer.size ();
for (auto &item : expr.params)