No functional change.
Details
Diff Detail
Event Timeline
include/clang/Basic/Sanitizers.h | ||
---|---|---|
28 | Leave this named as SanitizerOrdinal, so that SO_ prefix makes sense. | |
49 | Fix comments to reflect that we're checking/setting sets of sanitizers now. However, I think we might still use two different entities for SanitizerKind and SanitizerMask.... | |
62 | Any reason to make this public? | |
lib/CodeGen/CGExpr.cpp | ||
2246 | That's the problem I see with using SanitizerMask instead of SanitizerKind class enum - sometimes (like in this case) we want to distinguish between a *single* sanitizer kind and a set of sanitizers. Here, for example, what should we return if Kind contains both Vptr and Return? Add a method that would tell you if SanitizerMask contains a single kind, and assert in this function? | |
2304 | Same here - what if SanitizeRecover is defined for some bits in Checked[i].second, and not defined for another? |
- Address review comments
include/clang/Basic/Sanitizers.h | ||
---|---|---|
28 | Done. | |
49 |
These functions are for single sanitizers only. I've added assertion checks to enforce that.
I don't think we need to do that. In my opinion it just makes things more confusing. | |
62 | It makes the code simpler, as we don't need accessor functions in every case where we need to do some bit operation on the mask. | |
lib/CodeGen/CGExpr.cpp | ||
2246 |
Yes. It makes more sense to add dynamic checks to the rare function that accepts a single sanitizer, than to use two different enums and try to make sure that the right one is being used everywhere. | |
2304 | Added an assertion check to SanitizerSet::has. |
Thanks for doing this! Feel free to apply after addressing comments below.
lib/CodeGen/CGExpr.cpp | ||
---|---|---|
3389 | Looks like you don't need this cast (you don't have them in other places). | |
lib/Driver/SanitizerArgs.cpp | ||
113–116 | Please add parens: (Sanitizers.Mask & NeedsUbsanRt) | |
120 | ditto | |
147 | Consider using SanitizerMask type for local variables where appropriate | |
444–445 | clang-format this patch |
Leave this named as SanitizerOrdinal, so that SO_ prefix makes sense.