[flang-commits] [clang-tools-extra] [llvm] [compiler-rt] [clang] [flang] [clang] Add support for new loop attribute [[clang::code_align()]] (PR #70762)

Erich Keane via flang-commits flang-commits at lists.llvm.org
Mon Nov 13 11:02:11 PST 2023


================
@@ -334,11 +334,12 @@ CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo &CI,
     // This attribute requires an integer argument which is a constant power of
     // two between 1 and 4096 inclusive.
     int AlignValue = ArgVal.getSExtValue();
-    if (AlignValue < CodeAlignAttr::getMinValue() ||
-        AlignValue > CodeAlignAttr::getMaxValue() || !ArgVal.isPowerOf2()) {
+    static int MaximumAlignment = 4096;
----------------
erichkeane wrote:

Ah,  I meant these still as addition members, as static-constexpr.  That way it is still `CodeAlignAttr::MinimumAlignment` and `CodeAlignAttr::MaximumAlignment`, but not as a function that implies that it is not a constant value.

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


More information about the flang-commits mailing list