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

2023-11-17 Thread via cfe-commits
@@ -0,0 +1,164 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local -x c %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +void foo() { + int i; + int a[10], b[10]; + + [[clang::code_align(8)]] + for (i = 0; i < 10;

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

2023-11-17 Thread Erich Keane via cfe-commits
@@ -322,6 +322,81 @@ static Attr *handleUnlikely(Sema , Stmt *St, const ParsedAttr , return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo , +Expr *E) { + if

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

2023-11-17 Thread via cfe-commits
@@ -322,6 +322,77 @@ static Attr *handleUnlikely(Sema , Stmt *St, const ParsedAttr , return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo , +Expr *E) { + if

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

2023-11-17 Thread Erich Keane via cfe-commits
@@ -322,6 +322,77 @@ static Attr *handleUnlikely(Sema , Stmt *St, const ParsedAttr , return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo , +Expr *E) { + if

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

2023-11-17 Thread via cfe-commits
@@ -322,6 +322,73 @@ static Attr *handleUnlikely(Sema , Stmt *St, const ParsedAttr , return ::new (S.Context) UnlikelyAttr(S.Context, A); } +CodeAlignAttr *Sema::BuildCodeAlignAttr(const AttributeCommonInfo , +Expr *E) { + if

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

2023-11-14 Thread Erich Keane via cfe-commits
@@ -0,0 +1,126 @@ +// RUN: %clang_cc1 -fsyntax-only -verify=expected,c-local -x c %s +// RUN: %clang_cc1 -fsyntax-only -verify=expected,cpp-local -pedantic -x c++ -std=c++11 %s + +void foo() { + int i; + int a[10], b[10]; + + [[clang::code_align(8)]] + for (i = 0; i < 10;