]> granicus.if.org Git - clang/commitdiff
Work around MinGW's macro definition of 'interface' to 'struct'
authorReid Kleckner <rnk@google.com>
Tue, 31 May 2016 17:42:56 +0000 (17:42 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 31 May 2016 17:42:56 +0000 (17:42 +0000)
Previous attempts to rename the IBOutletCollection argument to something
other than "Interface" were undone (r127127 and r139620).  Instead of
renaming it, work around this in tablegen, so the public facing getter
can have the usual name of 'getInterface'.

Fixes PR26682

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271305 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/ClangAttrEmitter.cpp

index 2c25932bc78fc813f7eaade63dba1b52f1f4bae7..b6d1e24b907f0ab10e5618512f8274af8c6c4db3 100644 (file)
@@ -194,6 +194,11 @@ namespace {
         lowerName[0] = std::tolower(lowerName[0]);
         upperName[0] = std::toupper(upperName[0]);
       }
+      // Work around MinGW's macro definition of 'interface' to 'struct'. We
+      // have an attribute argument called 'Interface', so only the lower case
+      // name conflicts with the macro definition.
+      if (lowerName == "interface")
+        lowerName = "interface_";
     }
     virtual ~Argument() = default;