summaryrefslogtreecommitdiff
path: root/willow/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorStefan Weigl-Bosker <stefan@s00.xyz>2026-02-19 18:51:48 -0500
committerGitHub <noreply@github.com>2026-02-19 18:51:48 -0500
commitc2d4209f85f46cc91163bc47cc43db252c94acf6 (patch)
tree8d7f73ce6c3c89863418382d8d553a06c668bbb3 /willow/lib/IR/Verifier.cpp
parentd11fbc8268f5775ad783f8570478daad4a9e81cf (diff)
downloadcompiler-c2d4209f85f46cc91163bc47cc43db252c94acf6.tar.gz
[willow]: more cleanup, tests (#12)
Diffstat (limited to 'willow/lib/IR/Verifier.cpp')
-rw-r--r--willow/lib/IR/Verifier.cpp10
1 files changed, 7 insertions, 3 deletions
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