[clang-tools-extra] [clang-tidy][NFC] Replace usages of `DeclSpec::TQ` with `Qualifiers::TQ` (PR #113295)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 22 04:31:39 PDT 2024
================
@@ -71,15 +72,20 @@ static std::optional<FixItHint> fixIfNotDangerous(SourceLocation Loc,
// Build a string that can be emitted as FixIt with either a space in before
// or after the qualifier, either ' const' or 'const '.
-static std::string buildQualifier(DeclSpec::TQ Qualifier,
+static std::string buildQualifier(Qualifiers::TQ Qualifier,
bool WhitespaceBefore = false) {
if (WhitespaceBefore)
- return (llvm::Twine(' ') + DeclSpec::getSpecifierName(Qualifier)).str();
- return (llvm::Twine(DeclSpec::getSpecifierName(Qualifier)) + " ").str();
+ return (llvm::Twine(' ') +
+ DeclSpec::getSpecifierName(static_cast<DeclSpec::TQ>(Qualifier)))
----------------
Endilll wrote:
> Qualifiers::getAsString()
>From that I saw, it does much more than `getSpecifierName`. It also can serialize only a subset of qualifiers, because `Qualifiers::TQ` doesn't seem to support `__unaligned` and `_Atomic`. I think what I've done is an improvement over status quo, and I'd like to avoid going into the rabbit hole.
https://github.com/llvm/llvm-project/pull/113295
More information about the cfe-commits
mailing list