Yu-hsin Wang has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/43105 )

Change subject: base: Add a rename helper to SymbolTable
......................................................................

base: Add a rename helper to SymbolTable

In some cases, we want to move and copy the symbol table to another
address. However, the name of symbol table should be unique. This rename
helper provides a way to modify the name of symbol. Developers can use
it to solve the conflict with this helper.

Change-Id: I4627e06da3a03da57009d613188be117c75750a0
---
M src/base/loader/symtab.hh
1 file changed, 11 insertions(+), 0 deletions(-)



diff --git a/src/base/loader/symtab.hh b/src/base/loader/symtab.hh
index 5610544..a74bb76 100644
--- a/src/base/loader/symtab.hh
+++ b/src/base/loader/symtab.hh
@@ -154,6 +154,17 @@
     }

     SymbolTablePtr
+    rename(std::function<void(std::string&)> func) const
+    {
+        SymTabOp op = [func](SymbolTable &symtab, const Symbol &symbol) {
+            Symbol sym = symbol;
+            func(sym.name);
+            symtab.insert(sym);
+        };
+        return operate(op);
+    }
+
+    SymbolTablePtr
     globals() const
     {
         return filterByBinding(Symbol::Binding::Global);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/43105
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I4627e06da3a03da57009d613188be117c75750a0
Gerrit-Change-Number: 43105
Gerrit-PatchSet: 1
Gerrit-Owner: Yu-hsin Wang <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to