From c2d4209f85f46cc91163bc47cc43db252c94acf6 Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Thu, 19 Feb 2026 18:51:48 -0500 Subject: [willow]: more cleanup, tests (#12) --- willow/lib/IR/Verifier.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'willow/lib/IR/Verifier.cpp') diff --git a/willow/lib/IR/Verifier.cpp b/willow/lib/IR/Verifier.cpp index b622f10..125f7bc 100644 --- a/willow/lib/IR/Verifier.cpp +++ b/willow/lib/IR/Verifier.cpp @@ -8,6 +8,7 @@ namespace willow { +namespace { /// Verify that an instruction defines an SSA result LogicalResult verifyResult(const Instruction &inst, DiagnosticEngine &diags); /// Verify that an instruction does not define an ssa result @@ -18,9 +19,9 @@ LogicalResult verifyNumOperands(const Instruction &inst, DiagnosticEngine &diags, std::size_t expected); /// Verify operand type -LogicalResult expectOperandType(const Instruction &inst, - DiagnosticEngine &diags, std::size_t opidx, - Type expected); +// LogicalResult expectOperandType(const Instruction &inst, +// DiagnosticEngine &diags, std::size_t opidx, +// Type expected); LogicalResult expectOperandType(const Instruction &inst, DiagnosticEngine &diags, const Value *operand, Type expected); @@ -31,6 +32,7 @@ LogicalResult expectResultType(const Instruction &inst, DiagnosticEngine &diags, LogicalResult verifyBinaryIntegerInst(const Instruction &, DiagnosticEngine &); LogicalResult verifyBinaryIntegerCmp(WillowContext &ctx, const Instruction &, DiagnosticEngine &); +} LogicalResult verifyModule(WillowContext &ctx, const Module &module, DiagnosticEngine &diags) { @@ -282,6 +284,7 @@ LogicalResult verifyInst(WillowContext &ctx, const Instruction &inst, return success(); } +namespace { LogicalResult verifyBinaryIntegerInst(const Instruction &inst, DiagnosticEngine &diags) { Type ty = inst.getType(); @@ -402,5 +405,6 @@ LogicalResult expectResultType(const Instruction &inst, DiagnosticEngine &diags, return emit(diags, Severity::Error) << std::format( "unexpected result type: expected '{}', found '{}'", expected, ty); } +} } // namespace willow -- cgit v1.2.3