Use the newly available space in the bit-fields of Stmt.
This saves 8 bytes per BinaryOperator.
Details
Diff Detail
- Repository
- rC Clang
Event Timeline
Looks good - thanks! just a few things that could be cleaned up.
include/clang/AST/Expr.h | ||
---|---|---|
3220–3222 | Lost LLVM_READONLY somewhere along the way? Should it be added back in? | |
3256–3261 | I probably wouldn't add a new public member function here - I take it you added that to avoid calling getOpcode() twice? (either for performance or textual/source tersity?) Calling it twice probably is OK for both performance and readability - but if you prefer otherwise, I guess you could do it with a temporary: bool isPetrMemOp() const { auto Opc = getOpcode(); return Opc == ... ; } | |
3369–3375 | Could do these two (& some of the other "refactor to use a common accessor, because the accessor is getting a bit more interesting") changes as NFC cleanup before this - but no big deal, just mention it in case in other/future changes that makes sense for you. |
include/clang/AST/Stmt.h | ||
---|---|---|
572 | Oh, just a thought - wonder if we could/should have an assert that this anonymous union doesn't grow beyond a certain intended size? (can we have such an assert? I'm not sure how to test the size of an anonymous union - I guess we could static_assert the size of the whole Stmt class, though that'd be a bit brittle) |
Added some inline comments.
include/clang/AST/Expr.h | ||
---|---|---|
3220–3222 | On purpose. LLVM_READONLY on a simple getter seems pointless, | |
3259 | I added it for consistency with the other similar function below. | |
include/clang/AST/Stmt.h | ||
572 | Already done in line 657 below. And yes it is a valid concern ! |
Marked the inline comments as done since I believe I
answered each of them. If not I can fix it in a subsequent commit.
Lost LLVM_READONLY somewhere along the way? Should it be added back in?