Merge reloc_func and reloc_globalsym into reloc_external.

This commit is contained in:
Dan Gohman
2017-10-31 12:06:13 -07:00
parent b60b2ce135
commit 5d063eb8bc
12 changed files with 52 additions and 55 deletions

View File

@@ -35,6 +35,16 @@ pub enum GlobalVarData {
},
}
impl GlobalVarData {
/// Assume that `self` is an `GlobalVarData::Sym` and return its name.
pub fn symbol_name(&self) -> &ExternalName {
match *self {
GlobalVarData::Sym { ref name } => name,
_ => panic!("only symbols have names"),
}
}
}
impl fmt::Display for GlobalVarData {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {