From 83bc9e788563a83887a48f67ec28e10729bea965 Mon Sep 17 00:00:00 2001 From: an7s <an7s@git.zephyr-software.com> Date: Sun, 23 Jun 2013 15:25:26 +0000 Subject: [PATCH] added LookupAssembly() Former-commit-id: dd9fc21dfed052ad30cb21e3833364a71379d620 --- libIRDB/include/core/fileir.hpp | 2 ++ libIRDB/src/core/fileir.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/libIRDB/include/core/fileir.hpp b/libIRDB/include/core/fileir.hpp index bc69b9c20..d5c8b5f18 100644 --- a/libIRDB/include/core/fileir.hpp +++ b/libIRDB/include/core/fileir.hpp @@ -37,6 +37,8 @@ class FileIR_t : public BaseObj_t void AssembleRegistry(); void RegisterAssembly(Instruction_t *instr, std::string assembly); void UnregisterAssembly(Instruction_t *instr); + std::string LookupAssembly(Instruction_t *instr); + //Needed for inserting assembly before an instruction. //if orig is not registered, the function returns, otherwise //the instruction/assembly mapping of orig->assembly is altered to diff --git a/libIRDB/src/core/fileir.cpp b/libIRDB/src/core/fileir.cpp index ef39e8c36..0f0f56628 100644 --- a/libIRDB/src/core/fileir.cpp +++ b/libIRDB/src/core/fileir.cpp @@ -195,6 +195,13 @@ void FileIR_t::UnregisterAssembly(Instruction_t *instr) assembly_registry.erase(instr); } +std::string FileIR_t::LookupAssembly(Instruction_t *instr) +{ + if (assembly_registry.find(instr) != assembly_registry.end()) + return assembly_registry[instr]; + else + return std::string(); +} std::map<db_id_t,Function_t*> FileIR_t::ReadFuncsFromDB ( -- GitLab