aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.h
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2020-12-10 20:02:03 +0000
committerPhilip Herron <herron.philip@googlemail.com>2020-12-17 17:23:46 +0000
commit4fb0ab7e635c65318aadf958e0e1303f3435c4e5 (patch)
treeb1472ad8c7c1d23686231a1bf0a697db4c2aef92 /gcc/rust/rust-session-manager.h
parent2cfc6276dadc54aea9f8ce2a8cfefaee456f380e (diff)
downloadgcc-4fb0ab7e635c65318aadf958e0e1303f3435c4e5.zip
gcc-4fb0ab7e635c65318aadf958e0e1303f3435c4e5.tar.gz
gcc-4fb0ab7e635c65318aadf958e0e1303f3435c4e5.tar.bz2
This sets up a name resolution framework trying to follow rust-dev guide
We can use the NodeId from the AST to generate apropriate mappings for all names and types. Ribs are the scopes for names being instansiated, and reference to defintion tables allows all names to be resolved to NodeId's. Later on NodeIds will map over to HIR ids allowing for type resolution.
Diffstat (limited to 'gcc/rust/rust-session-manager.h')
-rw-r--r--gcc/rust/rust-session-manager.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/gcc/rust/rust-session-manager.h b/gcc/rust/rust-session-manager.h
index bdeeeec..2bb1dfb 100644
--- a/gcc/rust/rust-session-manager.h
+++ b/gcc/rust/rust-session-manager.h
@@ -1,6 +1,24 @@
+// Copyright (C) 2020 Free Software Foundation, Inc.
+
+// This file is part of GCC.
+
+// GCC is free software; you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3, or (at your option) any later
+// version.
+
+// GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with GCC; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+// #include "rust-session-manager.h"
+
#ifndef RUST_SESSION_MANAGER_H
#define RUST_SESSION_MANAGER_H
-// Session manager - controls compiler session.
#include "config.h"
#include "system.h"
@@ -11,12 +29,6 @@
#include "rust-linemap.h"
#include "rust-backend.h"
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-#include <utility>
-
namespace Rust {
// parser forward decl
template <typename ManagedTokenSource> class Parser;
@@ -32,7 +44,7 @@ struct TargetOptions
{
/* TODO: maybe make private and access through helpers to allow changes to
* impl */
- std::unordered_map<std::string, std::unordered_set<std::string>> features;
+ std::unordered_map<std::string, std::unordered_set<std::string> > features;
public:
// Returns whether a key is defined in the feature set.
@@ -160,6 +172,7 @@ struct CompileOptions
EXPANSION_DUMP,
RESOLUTION_DUMP,
TARGET_OPTION_DUMP,
+ HIR_DUMP,
// TODO: add more?
} dump_option;