[clang] a45647d - [clang][dataflow][NFC] Clarify guarantees on returned vector size for `runDataflowAnalysis`.

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Fri May 6 06:30:20 PDT 2022


Author: Yitzhak Mandelbaum
Date: 2022-05-06T13:30:01Z
New Revision: a45647d82b728a7ccdfe28338bb8a115dee7a735

URL: https://github.com/llvm/llvm-project/commit/a45647d82b728a7ccdfe28338bb8a115dee7a735
DIFF: https://github.com/llvm/llvm-project/commit/a45647d82b728a7ccdfe28338bb8a115dee7a735.diff

LOG: [clang][dataflow][NFC] Clarify guarantees on returned vector size for `runDataflowAnalysis`.

Adjusts the comment to specify that the output vector's size matches the number of CFG blocks.

Differential Revision: https://reviews.llvm.org/D125091

Added: 
    

Modified: 
    clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
index 40bace44ffbd5..f4d6a221abecc 100644
--- a/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
+++ b/clang/include/clang/Analysis/FlowSensitive/DataflowAnalysis.h
@@ -106,8 +106,9 @@ template <typename LatticeT> struct DataflowAnalysisState {
 };
 
 /// Performs dataflow analysis and returns a mapping from basic block IDs to
-/// dataflow analysis states that model the respective basic blocks. Indices
-/// of the returned vector correspond to basic block IDs. Returns an error if
+/// dataflow analysis states that model the respective basic blocks. The
+/// returned vector, if any, will have the same size as the number of CFG
+/// blocks, with indices corresponding to basic block IDs. Returns an error if
 /// the dataflow analysis cannot be performed successfully.
 template <typename AnalysisT>
 llvm::Expected<std::vector<


        


More information about the cfe-commits mailing list