This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by sammccall on Mar 27 2020, 10:51 AM.

Details

Summary

This makes it easier/safer to add bits (error) to other node types without
worrying about bit layout all the time.

For now, just use to implement the ad-hoc conversion functions.
Next: remove these functions and use this directly.

Diff Detail

Event Timeline

sammccall created this revision.Mar 27 2020, 10:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2020, 10:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
hokein accepted this revision.Mar 27 2020, 3:26 PM

nice, thanks!

clang/include/clang/AST/DependenceFlags.h
120

nit: this seems to be unused?

152

maybe make Bits as scoped enum? I find translate(V, Bits::UnexpandedPack, TypeDependence::UnexpandedPack) is clearer.

This revision is now accepted and ready to land.Mar 27 2020, 3:26 PM
sammccall marked 3 inline comments as done.Mar 27 2020, 4:15 PM
sammccall added inline comments.
clang/include/clang/AST/DependenceFlags.h
120

Removed. (It'll be back in the next patch, though)

152

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.

This revision was automatically updated to reflect the committed changes.
sammccall marked an inline comment as done.