[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 28 11:10:01 PDT 2024


================
@@ -23,6 +23,30 @@ int hasAttribute(AttributeCommonInfo::Syntax Syntax,
                  const IdentifierInfo *Scope, const IdentifierInfo *Attr,
                  const TargetInfo &Target, const LangOptions &LangOpts);
 
+inline const char* deuglifyAttrScope(StringRef Scope) {
+  if (Scope == "_Clang")
+    return "clang";
+  if (Scope == "__gnu__")
+    return "gnu";
+  if (Scope == "__msvc__")
+    return "msvc";
+  return nullptr;
+}
+
+inline const char* uglifyAttrScope(StringRef Scope) {
+  if (Scope == "clang")
+    return "_Clang";
+  if (Scope == "gnu")
+    return "__gnu__";
+  if (Scope == "msvc")
+    return "__msvc__";
+  return nullptr;
+}
+
+inline bool isPotentiallyUglyScope(StringRef Scope) {
----------------
erichkeane wrote:

isn't this the inverse?  These are the not-`ugly` ones, right?

https://github.com/llvm/llvm-project/pull/113765


More information about the cfe-commits mailing list