[clang] d608fee - [ARM, MVE] Fix user-namespace violation in arm_mve.h.
Simon Tatham via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 12 04:14:25 PDT 2020
Author: Simon Tatham
Date: 2020-03-12T11:13:50Z
New Revision: d608fee8399a9fa6f2819076131c6ac30cc16eef
URL: https://github.com/llvm/llvm-project/commit/d608fee8399a9fa6f2819076131c6ac30cc16eef
DIFF: https://github.com/llvm/llvm-project/commit/d608fee8399a9fa6f2819076131c6ac30cc16eef.diff
LOG: [ARM,MVE] Fix user-namespace violation in arm_mve.h.
Summary:
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.
Reviewers: miyuki, MarkMurrayARM, ostannard
Reviewed By: miyuki
Subscribers: kristof.beyls, dmgreen, danielkiss, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75997
Added:
Modified:
clang/utils/TableGen/MveEmitter.cpp
Removed:
################################################################################
diff --git a/clang/utils/TableGen/MveEmitter.cpp b/clang/utils/TableGen/MveEmitter.cpp
index 9a9fe00eed74..f75f5000f0f6 100644
--- a/clang/utils/TableGen/MveEmitter.cpp
+++ b/clang/utils/TableGen/MveEmitter.cpp
@@ -1874,7 +1874,7 @@ void MveEmitter::EmitHeader(raw_ostream &OS) {
// 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 @@ void CdeEmitter::EmitHeader(raw_ostream &OS) {
// 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";
More information about the cfe-commits
mailing list