This is an archive of the discontinued LLVM Phabricator instance.

[NFC] [Clang] Use global enum for explicit float mode
ClosedPublic

Authored by qiucf on Oct 8 2021, 1:55 AM.

Details

Summary

Currently, there're multiple float types that can be represented by __attribute__((mode(xx))). It's parsed, and then a corresponding type is created if available.

This refactor moves the enum for mode into a global enum class visible to ASTContext, as discussed in D109950.

Diff Detail

Event Timeline

qiucf requested review of this revision.Oct 8 2021, 1:55 AM
qiucf created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptOct 8 2021, 1:55 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Oct 8 2021, 4:38 AM

LGTM, thanks for the cleanup!

clang/lib/Sema/SemaDeclAttr.cpp
4209

This bit looks like it's not an NFC change -- we never used to set this value before. However, it is an NFC change because the caller always sets ExplicitType to NoFloat, so this is more for safety when adding new callers, which is fine by me.

This revision is now accepted and ready to land.Oct 8 2021, 4:38 AM
erichkeane accepted this revision.Oct 8 2021, 6:13 AM
This revision was automatically updated to reflect the committed changes.