aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/util
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/util')
-rw-r--r--gcc/rust/util/rust-hir-map.cc1
-rw-r--r--gcc/rust/util/rust-mapping-common.h9
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-hir-map.cc b/gcc/rust/util/rust-hir-map.cc
index 47f9175..7bacc4c 100644
--- a/gcc/rust/util/rust-hir-map.cc
+++ b/gcc/rust/util/rust-hir-map.cc
@@ -754,6 +754,7 @@ Mappings::insert_macro_def (AST::MacroRulesDefinition *macro)
{"include_bytes", MacroBuiltin::include_bytes},
{"include_str", MacroBuiltin::include_str},
{"compile_error", MacroBuiltin::compile_error},
+ {"concat", MacroBuiltin::concat},
};
auto builtin = builtin_macros.find (macro->get_rule_name ());
diff --git a/gcc/rust/util/rust-mapping-common.h b/gcc/rust/util/rust-mapping-common.h
index 42a4e8e..27faa7f 100644
--- a/gcc/rust/util/rust-mapping-common.h
+++ b/gcc/rust/util/rust-mapping-common.h
@@ -50,6 +50,15 @@ struct DefId
return ((uint64_t) this->crateNum << 32 | this->localDefId)
< ((uint64_t) other.crateNum << 32 | other.localDefId);
}
+
+ std::string as_string () const
+ {
+ std::string buf;
+ buf += std::to_string (crateNum);
+ buf += " "; // or anything else
+ buf += std::to_string (localDefId);
+ return buf;
+ }
};
#define UNKNOWN_CREATENUM ((uint32_t) (0))