Skip to content

Commit

Permalink
Fix unused private field warnings.
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <fruffy@nyu.edu>
  • Loading branch information
fruffy committed Nov 9, 2024
1 parent 9f5e864 commit 6083b32
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 28 deletions.
8 changes: 2 additions & 6 deletions backends/tofino/bf-p4c/arch/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,9 @@ using DefaultPortMap = std::map<int, std::vector<int>>;
/** \ingroup ArchTranslation */
class ParseTna : public Inspector {
const IR::PackageBlock *mainBlock = nullptr;
P4::ReferenceMap *refMap;
P4::TypeMap *typeMap;

public:
ParseTna(P4::ReferenceMap *refMap, P4::TypeMap *typeMap) : refMap(refMap), typeMap(typeMap) {
setName("ParseTna");
}
ParseTna() { setName("ParseTna"); }

// parse tna pipeline with single parser.
void parseSingleParserPipeline(const IR::PackageBlock *block, unsigned index);
Expand Down Expand Up @@ -382,7 +378,7 @@ struct DoRewriteControlAndParserBlocks : Transform {
struct RewriteControlAndParserBlocks : public PassManager {
RewriteControlAndParserBlocks(P4::ReferenceMap *refMap, P4::TypeMap *typeMap) {
auto *evaluator = new P4::EvaluatorPass(refMap, typeMap);
auto *parseTna = new ParseTna(refMap, typeMap);
auto *parseTna = new ParseTna();

passes.push_back(evaluator);
passes.push_back(new VisitFunctor([evaluator, parseTna](const IR::Node *root) {
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-p4c/arch/v1model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,7 @@ SimpleSwitchTranslation::SimpleSwitchTranslation(P4::ReferenceMap *refMap, P4::T
new V1::InsertChecksumError(parserChecksums),
new V1::InsertChecksumDeposit(parserChecksums),
new AddMetadataParserStates(refMap, typeMap),
new BFN::AddAdjustByteCount(structure, refMap, typeMap),
new BFN::AddAdjustByteCount(structure),
new P4::EliminateSerEnums(typeMap),
new BFN::FindArchitecture(),
new TranslationLast(),
Expand Down
6 changes: 1 addition & 5 deletions backends/tofino/bf-p4c/arch/v1model.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ namespace BFN {
/** \ingroup SimpleSwitchTranslation */
class AddAdjustByteCount : public Modifier {
V1::ProgramStructure *structure;
P4::ReferenceMap *refMap;
P4::TypeMap *typeMap;
bool preorder(IR::Declaration_Instance *decl) override;

public:
AddAdjustByteCount(V1::ProgramStructure *structure, P4::ReferenceMap *refMap,
P4::TypeMap *typeMap)
: structure(structure), refMap(refMap), typeMap(typeMap) {}
explicit AddAdjustByteCount(V1::ProgramStructure *structure) : structure(structure) {}
};

/**
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-p4c/common/bridged_packing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2335,7 +2335,7 @@ bool ExtractBridgeInfo::preorder(const IR::P4Program *program) {
BUG_CHECK(toplevel, "toplevel cannot be nullptr");

auto main = toplevel->getMain();
auto arch = new BFN::ParseTna(refMap, typeMap);
auto arch = new BFN::ParseTna();
main->apply(*arch);

/// SimplifyReferences passes are fixup passes that modifies the visited IR tree.
Expand Down
5 changes: 2 additions & 3 deletions backends/tofino/bf-p4c/common/extract_maupipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,10 @@ class BackendConverter : public Inspector {
: refMap(refMap),
typeMap(typeMap),
bindings(bindings),
arch(new ParseTna()),
pipe(pipe),
pipes(pipes),
sourceInfoLogging(sourceInfoLogging) {
arch = new ParseTna(refMap, typeMap);
}
sourceInfoLogging(sourceInfoLogging) {}

ordered_map<int, const IR::BFN::Pipe *> &getPipes() { return pipes; }
cstring getPipelineName(const IR::P4Program *program, int index);
Expand Down
12 changes: 4 additions & 8 deletions backends/tofino/bf-p4c/phv/fieldslice_live_range.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ class FieldSliceLiveRangeDB : public IFieldSliceLiveRangeDB, public PassManager
const ClotInfo &clot;
const MauBacktracker *backtracker;
const FieldDefUse *defuse;
const MapFieldSliceToAction *fs_action_map;
FieldSliceLiveRangeDB &self;
const PHV::Pragmas &pragmas;

Expand Down Expand Up @@ -214,18 +213,16 @@ class FieldSliceLiveRangeDB : public IFieldSliceLiveRangeDB, public PassManager

public:
DBSetter(const PhvInfo &phv, const ClotInfo &clot, const MauBacktracker *backtracker,
const FieldDefUse *defuse, const MapFieldSliceToAction *fs_action_map,
FieldSliceLiveRangeDB &self, const PHV::Pragmas &pragmas)
const FieldDefUse *defuse, FieldSliceLiveRangeDB &self,
const PHV::Pragmas &pragmas)
: phv(phv),
clot(clot),
backtracker(backtracker),
defuse(defuse),
fs_action_map(fs_action_map),
self(self),
pragmas(pragmas) {}
};

const PHV::Pragmas &pragmas;
MapFieldSliceToAction *fs_action_map;
DBSetter *setter;

Expand All @@ -237,10 +234,9 @@ class FieldSliceLiveRangeDB : public IFieldSliceLiveRangeDB, public PassManager
public:
FieldSliceLiveRangeDB(const MauBacktracker *backtracker, const FieldDefUse *defuse,
const PhvInfo &phv, const ReductionOrInfo &red_info, const ClotInfo &clot,
const PHV::Pragmas &pragmas)
: pragmas(pragmas) {
const PHV::Pragmas &pragmas) {
fs_action_map = new MapFieldSliceToAction(phv, red_info);
setter = new DBSetter(phv, clot, backtracker, defuse, fs_action_map, *this, pragmas);
setter = new DBSetter(phv, clot, backtracker, defuse, *this, pragmas);
addPasses({fs_action_map, setter});
}
/// @returns a const pointer to live range info, nullptr if not exist.
Expand Down
1 change: 0 additions & 1 deletion backends/tofino/bf-p4c/phv/v2/greedy_tx_score.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class GreedyTxScoreMaker : public TxScoreMaker {
/// GreedyTxScore is the default allocation heuristics.
class GreedyTxScore : public TxScore {
private:
const GreedyTxScoreMaker *maker_i = nullptr;
const Vision *vision_i;

/// the most precious container bits: normal container and potentially mocha bits
Expand Down
3 changes: 0 additions & 3 deletions backends/tofino/bf-p4c/phv/v2/utils_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,6 @@ class ScoreContext {
/// search time related parameters.
const SearchConfig *search_config_i = new SearchConfig();

/// tracer will try to log steps of every allocation.
std::ostream *tracer = nullptr;

private:
static constexpr const char *tab_table[] = {
"", " ", " ", " ", " ", " ", " ", " ", " ",
Expand Down

0 comments on commit 6083b32

Please sign in to comment.