This clears the way for adding an Error dependence bit to Type and having it
mostly-automatically propagated.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This mostly corresponds to the Expr refactoring in ec3060c72de6ab6992269318d92764199856e5fe, without the followup moving it to ComputeDependence yet.
I used a constructor param to assist in the refactoring and because most cases are really simple.
clang/include/clang/AST/Type.h | ||
---|---|---|
2882 | we have behavior change for VariableModified bit, now it is Cls|Pointee vs Pointee before | |
clang/include/clang/AST/TypeProperties.td | ||
462 | nit: the line length seems > 80 columns. | |
clang/lib/AST/Type.cpp | ||
3036 | when converting an ExprDep to TypeDep, we simply drop the value-dependent bit, so here we will not set the instantiation-bit for typeDep if NoexceptExpr is value dependent but not instantiation-dependent. |
Address comments
clang/include/clang/AST/Type.h | ||
---|---|---|
2882 | Good catch! | |
clang/lib/AST/Type.cpp | ||
3036 |
This never happens - value-dependence implies instantiation-dependence. (Incidentally this means we could model instantiation/value/type dependence as as unsigned : 2 - this would save a bit and make some of the logic clearer, like that "turn type to value dependence" is a downgrade) |
Thanks.
clang/lib/AST/Type.cpp | ||
---|---|---|
3036 | ah, right. I missed the fact that value-dependence implies instantiation-dependence when reading the code. |
we have behavior change for VariableModified bit, now it is Cls|Pointee vs Pointee before