Page MenuHomePhabricator

[clang][ToolChains] explicitly return LangOptions::StackProtectorMode
ClosedPublic

Authored by nickdesaulniers on Oct 27 2020, 3:34 PM.

Details

Summary

Make the virtual method Toolchain::GetDefaultStackProtectorLevel()
return an explict enum value rather than an integral constant. This
makes the code subjectively easier to read, and should help prevent bugs
that may (or may never) arise from changing the enum values. Previously,
these were just kept in sync via a comment, which is brittle. The trade
off is including a additional header in a few new places. It is not
necessary, but in my opinion helps the readability.

Split off from https://reviews.llvm.org/D90194 to help cut down on lines
changed in code review.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 3:34 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nickdesaulniers requested review of this revision.Oct 27 2020, 3:34 PM
phosek accepted this revision.Oct 27 2020, 4:45 PM

LGTM

This revision is now accepted and ready to land.Oct 27 2020, 4:45 PM
This revision was landed with ongoing or failed builds.Oct 28 2020, 11:21 AM
This revision was automatically updated to reflect the committed changes.