[PATCH] D65196: [CFG] Introduce CFGElementRef, a wrapper that knows it's position in a CFGBlock
Kristóf Umann via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 24 03:23:26 PDT 2019
Szelethus created this revision.
Szelethus added reviewers: NoQ, xazax.hun, baloghadamsoftware, Charusso, dcoughlin, rnkovacs, a_sidorin.
Szelethus added a project: clang.
Herald added subscribers: cfe-commits, gamesh411, dkrupp.
Previously, collecting `CFGElement`s in a set was practially impossible, because both `CFGBlock::operator[]` and both the iterators returned it by value. One workaround would be to collect the iterators instead, but they don't really capture the concept of an element, and elements from different iterator types are incomparable.
This patch introduces `CFGElementRef`, a wrapper around a `(CFGBlock, Index)` pair, and a variety of new iterators and iterator ranges to solve this problem.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D65196
Files:
clang/include/clang/Analysis/CFG.h
clang/lib/Analysis/CFG.cpp
clang/unittests/Analysis/CFGTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65196.211455.patch
Type: text/x-patch
Size: 14316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190724/00c3888b/attachment.bin>
More information about the cfe-commits
mailing list