[PATCH] D76939: [AST] Add a Dependence bitmask to use for calculations with multiple node types.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 27 16:32:48 PDT 2020


sammccall marked 3 inline comments as done.
sammccall added inline comments.


================
Comment at: clang/include/clang/AST/DependenceFlags.h:120
+
+  Dependence(Bits V) : V(V) {}
+
----------------
hokein wrote:
> nit: this seems to be unused?
Removed. (It'll be back in the next patch, though)


================
Comment at: clang/include/clang/AST/DependenceFlags.h:152
+  TypeDependence type() const {
+    return translate(V, UnexpandedPack, TypeDependence::UnexpandedPack) |
+           translate(V, Instantiation, TypeDependence::Instantiation) |
----------------
hokein wrote:
> maybe make `Bits` as scoped enum? I find `translate(V, Bits::UnexpandedPack, TypeDependence::UnexpandedPack)` is clearer.
The main users will be outside this file, e.g. in ComputeDependence

```
Dependence D;
if (whatever)
  D.add(Dependence::Instantiation);
```

I think these read a lot better without another qualifier.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76939/new/

https://reviews.llvm.org/D76939





More information about the cfe-commits mailing list