Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Unified Diff: syzygy/refinery/types/type_repository.h

Issue 1475083002: [Refinery] Introduce TypePropagatorAnalyzer - pointer types. (Closed) Base URL: https://github.com/google/syzygy.git@master
Patch Set: Final nit Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « syzygy/refinery/symbols/symbol_provider.h ('k') | syzygy/refinery/types/type_repository.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: syzygy/refinery/types/type_repository.h
diff --git a/syzygy/refinery/types/type_repository.h b/syzygy/refinery/types/type_repository.h
index 1c49d294f5de963774f2ff2772a3d6faaad50f2e..578067bae84f767c8b0d9289336d1fa637748905 100644
--- a/syzygy/refinery/types/type_repository.h
+++ b/syzygy/refinery/types/type_repository.h
@@ -22,6 +22,7 @@
#include "base/macros.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
+#include "syzygy/pe/pe_file.h"
namespace refinery {
@@ -31,11 +32,14 @@ using TypePtr = scoped_refptr<Type>;
// Keeps type instances, assigns them an ID and vends them out by ID on demand.
// TODO(manzagop): cleave the interface so as to obtain something immutable.
+// TODO(manzagop): abstract the module id away from a pe file signature.
class TypeRepository : public base::RefCounted<TypeRepository> {
public:
class Iterator;
+ // TODO(manzagop): make it mandatory to provide a module signature.
TypeRepository();
+ explicit TypeRepository(const pe::PEFile::Signature& signature);
// Retrieve a type by @p id.
TypePtr GetType(TypeId id) const;
@@ -49,6 +53,10 @@ class TypeRepository : public base::RefCounted<TypeRepository> {
// @returns true on success, failure typically means id is already taken.
bool AddTypeWithId(TypePtr type, TypeId id);
+
+ // Get the signature for the module this type represents.
+ bool GetModuleSignature(pe::PEFile::Signature* signature);
+
// @name Accessors.
// @{
size_t size() const;
@@ -60,6 +68,8 @@ class TypeRepository : public base::RefCounted<TypeRepository> {
friend class base::RefCounted<TypeRepository>;
~TypeRepository();
+ bool is_signature_set_;
+ pe::PEFile::Signature signature_;
base::hash_map<TypeId, TypePtr> types_;
DISALLOW_COPY_AND_ASSIGN(TypeRepository);
« no previous file with comments | « syzygy/refinery/symbols/symbol_provider.h ('k') | syzygy/refinery/types/type_repository.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698