From 0479a76cdd2227af6a0381e29e370d1a2a86daa4 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Tue, 9 Jul 2024 12:53:17 +0800 Subject: [PATCH] cfg: Add some doc comments for commonly used fields. --- cfg/CFG.h | 4 +++- cfg/Instructions.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cfg/CFG.h b/cfg/CFG.h index 72fa0a674..a9d4c310f 100644 --- a/cfg/CFG.h +++ b/cfg/CFG.h @@ -50,9 +50,11 @@ class BlockExit final { /// for different parts of the RHS. class Binding final { public: + /// LHS for a single "assignment" in the CFG. VariableUseSite bind; + /// Location for the full "assignment" (use bind.loc if you need the location for the LHS only). core::LocOffsets loc; - + /// RHS for a single "assignment" in the CFG. InstructionPtr value; Binding(LocalOccurrence bind, core::LocOffsets loc, InstructionPtr value); diff --git a/cfg/Instructions.h b/cfg/Instructions.h index 55be75407..ad22e2926 100644 --- a/cfg/Instructions.h +++ b/cfg/Instructions.h @@ -31,6 +31,7 @@ class VariableUseSite final { public: LocalRef variable; core::TypePtr type; + /// Location for the LHS of an "assignment" in the CFG. core::LocOffsets loc; VariableUseSite() = default; VariableUseSite(LocalRef local) : variable(local){};