mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
report_manager: store report -> program mapping
This commit is contained in:
parent
fd7f30a5b5
commit
f40aa6bd40
@ -3771,6 +3771,7 @@ u32 buildReportPrograms(RoseBuildImpl &build, build_context &bc) {
|
|||||||
program = flattenProgram({program});
|
program = flattenProgram({program});
|
||||||
applyFinalSpecialisation(program);
|
applyFinalSpecialisation(program);
|
||||||
programs[id] = writeProgram(bc, program);
|
programs[id] = writeProgram(bc, program);
|
||||||
|
build.rm.setProgramOffset(id, programs[id]);
|
||||||
DEBUG_PRINTF("program for report %u @ %u (%zu instructions)\n", id,
|
DEBUG_PRINTF("program for report %u @ %u (%zu instructions)\n", id,
|
||||||
programs.back(), program.size());
|
programs.back(), program.size());
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Intel Corporation
|
* Copyright (c) 2015-2016, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -217,6 +217,18 @@ Report ReportManager::getBasicInternalReport(const NGWrapper &g, s32 adj) {
|
|||||||
return makeECallback(g.reportId, adj, ekey);
|
return makeECallback(g.reportId, adj, ekey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReportManager::setProgramOffset(ReportID id, u32 programOffset) {
|
||||||
|
assert(id < reportIds.size());
|
||||||
|
assert(!contains(reportIdToProgramOffset, id));
|
||||||
|
reportIdToProgramOffset.emplace(id, programOffset);
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 ReportManager::getProgramOffset(ReportID id) const {
|
||||||
|
assert(id < reportIds.size());
|
||||||
|
assert(contains(reportIdToProgramOffset, id));
|
||||||
|
return reportIdToProgramOffset.at(id);
|
||||||
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void ekeysUnion(std::set<u32> *ekeys, u32 more) {
|
void ekeysUnion(std::set<u32> *ekeys, u32 more) {
|
||||||
if (!ekeys->empty()) {
|
if (!ekeys->empty()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Intel Corporation
|
* Copyright (c) 2015-2016, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -113,6 +113,14 @@ public:
|
|||||||
* ~0U if no dkey is needed. */
|
* ~0U if no dkey is needed. */
|
||||||
u32 getDkey(const Report &r) const;
|
u32 getDkey(const Report &r) const;
|
||||||
|
|
||||||
|
/** \brief Register a Rose program offset with the given report. */
|
||||||
|
void setProgramOffset(ReportID id, u32 programOffset);
|
||||||
|
|
||||||
|
/** \brief Fetch the program offset for a given report. It is a fatal error
|
||||||
|
* for this to be called with a report for which no program offset has been
|
||||||
|
* set. */
|
||||||
|
u32 getProgramOffset(ReportID id) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** \brief Grey box ref, for checking resource limits. */
|
/** \brief Grey box ref, for checking resource limits. */
|
||||||
const Grey &grey;
|
const Grey &grey;
|
||||||
@ -127,6 +135,9 @@ private:
|
|||||||
/** \brief Mapping from ReportID to dedupe key. */
|
/** \brief Mapping from ReportID to dedupe key. */
|
||||||
std::map<ReportID, u32> reportIdToDedupeKey;
|
std::map<ReportID, u32> reportIdToDedupeKey;
|
||||||
|
|
||||||
|
/** \brief Mapping from ReportID to Rose program offset in bytecode. */
|
||||||
|
std::map<ReportID, u32> reportIdToProgramOffset;
|
||||||
|
|
||||||
/** \brief Mapping from external match ids to information about that
|
/** \brief Mapping from external match ids to information about that
|
||||||
* id. */
|
* id. */
|
||||||
std::map<ReportID, external_report_info> externalIdMap;
|
std::map<ReportID, external_report_info> externalIdMap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user