[PATCH] D75997: [ARM,MVE] Fix user-namespace violation in arm_mve.h.

Simon Tatham via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 11 09:04:42 PDT 2020


simon_tatham created this revision.
simon_tatham added reviewers: miyuki, MarkMurrayARM, ostannard.
Herald added subscribers: cfe-commits, danielkiss, dmgreen, kristof.beyls.
Herald added a project: clang.

We were generating the declarations of polymorphic intrinsics using
`__attribute__((overloadable))`. But `overloadable` is a valid
identifier for an end user to define as a macro in a C program, and if
they do that before including `<arm_mve.h>`, then we shouldn't cause a
compile error.

Fixed to spell the attribute name `__overloadable__` instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75997

Files:
  clang/utils/TableGen/MveEmitter.cpp


Index: clang/utils/TableGen/MveEmitter.cpp
===================================================================
--- clang/utils/TableGen/MveEmitter.cpp
+++ clang/utils/TableGen/MveEmitter.cpp
@@ -1874,7 +1874,7 @@
         // match your call".
 
         OS << "static __inline__ __attribute__(("
-           << (Polymorphic ? "overloadable, " : "")
+           << (Polymorphic ? "__overloadable__, " : "")
            << "__clang_arm_builtin_alias(__builtin_arm_mve_" << Int.fullName()
            << ")))\n"
            << RetTypeName << FunctionName << "(" << ArgTypesString << ");\n";
@@ -2041,7 +2041,7 @@
       // Emit the actual declaration. See MveEmitter::EmitHeader for detailed
       // comments
       OS << "static __inline__ __attribute__(("
-         << (Polymorphic ? "overloadable, " : "")
+         << (Polymorphic ? "__overloadable__, " : "")
          << "__clang_arm_builtin_alias(__builtin_arm_" << Int.builtinExtension()
          << "_" << Int.fullName() << ")))\n"
          << RetTypeName << FunctionName << "(" << ArgTypesString << ");\n";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75997.249638.patch
Type: text/x-patch
Size: 1068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200311/9906c8b2/attachment-0001.bin>


More information about the cfe-commits mailing list