aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-resolve-path.cc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-10 17:08:13 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-10 19:28:10 +0000
commitb2aa172ff69591452e3566c105f2a4cd8450eab5 (patch)
treef9ba781f9c6b29fd8d70f1964f7e238d1ade4f77 /gcc/rust/backend/rust-compile-resolve-path.cc
parent1b487d72cd2ba46671f5a1bcc20970f2dad1b759 (diff)
downloadgcc-b2aa172ff69591452e3566c105f2a4cd8450eab5.zip
gcc-b2aa172ff69591452e3566c105f2a4cd8450eab5.tar.gz
gcc-b2aa172ff69591452e3566c105f2a4cd8450eab5.tar.bz2
Refactor code to reuse a canonical way to compile functions and constants
This is a big cleanup so all paths that compile functions and constants end up in the same path so we avoid any duplication in how we actually compile a function.
Diffstat (limited to 'gcc/rust/backend/rust-compile-resolve-path.cc')
-rw-r--r--gcc/rust/backend/rust-compile-resolve-path.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/backend/rust-compile-resolve-path.cc b/gcc/rust/backend/rust-compile-resolve-path.cc
index c624046..2ef1232 100644
--- a/gcc/rust/backend/rust-compile-resolve-path.cc
+++ b/gcc/rust/backend/rust-compile-resolve-path.cc
@@ -16,10 +16,10 @@
// along with GCC; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-#include "rust-linemap.h"
-#include "rust-backend.h"
#include "rust-compile-resolve-path.h"
#include "rust-compile-item.h"
+#include "rust-compile-implitem.h"
+#include "rust-compile-expr.h"
#include "rust-hir-trait-resolve.h"
#include "rust-hir-path-probe.h"
@@ -131,7 +131,7 @@ ResolvePathRef::resolve (const HIR::PathIdentSegment &final_segment,
tree fn = NULL_TREE;
if (ctx->lookup_function_decl (fntype->get_ty_ref (), &fn))
{
- return ctx->get_backend ()->function_code_expression (fn, expr_locus);
+ return address_expression (fn, expr_locus);
}
}
@@ -245,8 +245,8 @@ HIRCompileBase::query_compile (HirId ref, TyTy::BaseType *lookup,
associated->setup_associated_types ();
return CompileTraitItem::Compile (
- receiver, trait_item_ref->get_hir_trait_item (), ctx, lookup,
- true, expr_locus);
+ trait_item_ref->get_hir_trait_item (), ctx, lookup, true,
+ expr_locus);
}
else
{