From 184f3f01ece8f8ffe0ef8ef71166a6008d5ec02d Mon Sep 17 00:00:00 2001
From: Jason Hiser <jdhiser@gmail.com>
Date: Thu, 31 Jan 2019 19:26:19 -0500
Subject: [PATCH] refactoring libirdb-util and libirdb-syscall

---
 include/interfaces/irdb/STARSInterface.h | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/include/interfaces/irdb/STARSInterface.h b/include/interfaces/irdb/STARSInterface.h
index 068205a1..466a93eb 100644
--- a/include/interfaces/irdb/STARSInterface.h
+++ b/include/interfaces/irdb/STARSInterface.h
@@ -10,7 +10,7 @@
 #include <elfio/elfio.hpp>
 
 #include <irdb-core>
-#include <libIRDB-util.hpp>
+#include <irdb-util>
 #include <assert.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -38,14 +38,16 @@ public:
 
 // Constructors
 	STARS_IRDB_Interface_t(IRDB_SDK::FileIR_t* p_firp, IRDB_SDK::pqxxDB_t &p_pqxx_interface) : 
-		CGCBinary(false), firp(p_firp), pqxx_interface(p_pqxx_interface) 
+		CGCBinary(false), 
+		firp(p_firp), 
+		pqxx_interface(p_pqxx_interface),
+		instruction_predsp(IRDB_SDK::InstructionPredecessors_t::factory(firp)),
+		instruction_preds(*instruction_predsp),
+	 	IBT_provsp(IRDB_SDK::IBTProvenance_t::factory(firp)),
+	 	IBT_provs(*IBT_provsp)
 	{ 
 		InitSegments();
 		InitFunctions();
-		// init instruction predecessors.
-		instruction_preds.AddFile(p_firp);
-				// init IBT provenance info
-				IBT_provs.AddFile(p_firp);
 		InitIBTAMaps();
 	}
 
@@ -324,8 +326,10 @@ private:
 	IRDB_SDK::FileIR_t *firp;
 	IRDB_SDK::pqxxDB_t &pqxx_interface;
 
-	libIRDB::InstructionPredecessors_t instruction_preds;
-	libIRDB::IBTProvenance_t IBT_provs;
+	std::unique_ptr<IRDB_SDK::InstructionPredecessors_t> instruction_predsp;
+	IRDB_SDK::InstructionPredecessors_t& instruction_preds;
+	std::unique_ptr<IRDB_SDK::IBTProvenance_t> IBT_provsp;
+	IRDB_SDK::IBTProvenance_t& IBT_provs;
 
 	friend class STARS_IRDB_Function_t;
 };
-- 
GitLab