summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2021-09-21 14:05:19 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2021-09-22 16:37:13 +0900
commit0dea31c437abc59c80ece31e94cc5f8fb562c3e0 (patch)
tree7969fbd7848841cbb8ce48e9333289d36a1148a1
parentecaf3a391d7f84ea8893d75940c1958aa2374b68 (diff)
RBIMPL_ATTR_NOALIAS: not until LLVM 12
I observed CI failures. https://github.com/ruby/ruby/actions/runs/1240165911 It turns out that RBIMPL_ATTR_NOALIAS was not mature before. Skip using it for old clang, and everything work as expected.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4848
-rw-r--r--include/ruby/internal/attr/noalias.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/ruby/internal/attr/noalias.h b/include/ruby/internal/attr/noalias.h
index 8e508b2bd3..0790ef60e5 100644
--- a/include/ruby/internal/attr/noalias.h
+++ b/include/ruby/internal/attr/noalias.h
@@ -46,10 +46,21 @@
* that has to be passed to the function as a pointer. ::VALUE -taking
* functions thus cannot be attributed as such.
*/
+#include "ruby/internal/compiler_since.h"
#include "ruby/internal/has/declspec_attribute.h"
/** Wraps (or simulates) `__declspec((noalias))` */
-#if RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias)
+#if RBIMPL_COMPILER_BEFORE(Clang, 12, 0, 0)
+# /*
+# * `::llvm::Attribute::ArgMemOnly` was buggy before. Maybe because nobody
+# * actually seriously used it. It seems they somehow mitigated the situation
+# * in LLVM 12. Still not found the exact changeset which fiexed the
+# * attribute, though.
+# *
+# * :FIXME: others (armclang, xlclang, ...) can also be affected?
+# */
+# define RBIMPL_ATTR_NOALIAS() /* void */
+#elif RBIMPL_HAS_DECLSPEC_ATTRIBUTE(noalias)
# define RBIMPL_ATTR_NOALIAS() __declspec(noalias)
#else
# define RBIMPL_ATTR_NOALIAS() /* void */