This change allow a CastExpr to have optional FPOptionsOverride object,
stored in trailing storage. Of all cast nodes only ImplicitCastExpr,
CStyleCastExpr, CXXFunctionalCastExpr and CXXStaticCastExpr are allowed
to have FPOptions.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
You mentioned in D85920 a need to merge this review with that review. I don't think that's needed. This code here is farther along. It does everything that D85920 does and has necessary pieces implemented as well.
I think this ticket should go into the tree instead of D85920. I'd sign off on it this minute if I had more experience in clang.
I think you are right. I looked through D85920, in essence it does the same changes as this patch. And this patch has better support of serialization and some tests.
Minor request, but otherwise LGTM.
clang/lib/Analysis/BodyFarm.cpp | ||
---|---|---|
184 | Can these call sites just be changed to use makeImplicitCast? |
This change allow a CallExpr to have optional FPOptionsOverride object,
Should this be CastExpr instead?
stored in trailing storage. The implementaion is made similar to the way
used in CallExpr.
Nit, but that's not really similar. In the CallExpr case the trailing objects are directly managed by CallExpr without using TrailingObjects in the sub-classes.
clang/include/clang/AST/Expr.h | ||
---|---|---|
3470 | Can you document that hasStoredFPFeatures() must be true as a pre-condition? | |
3616 | Here and elsewhere: numTrailingObjects is not part of the public interface. | |
clang/include/clang/AST/ExprCXX.h | ||
475–476 | /*frob=*/false here and elsewhere. |
Yes, thank you for the catch.
stored in trailing storage. The implementaion is made similar to the way
used in CallExpr.Nit, but that's not really similar. In the CallExpr case the trailing objects are directly managed by CallExpr without using TrailingObjects in the sub-classes.
This implementation was obtained by applying changes similar to those made for CallExpr. But you are right, there is some difference in the implementations. I think this statement is not too useful so removed it.
clang/include/clang/AST/Expr.h | ||
---|---|---|
3616 | Moved these methods to private section. |
Follow-up on my previous request. It's fine by me if you commit with that fix.
clang/lib/Analysis/BodyFarm.cpp | ||
---|---|---|
184 | Can you do the one in makeIntegralCast, too? Thanks. |
Can you document that hasStoredFPFeatures() must be true as a pre-condition?