[PATCH] D126984: [clang] Add initial support for gcc's optimize function attribute

Stephen Long via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 10 14:14:02 PDT 2022


steplong added inline comments.


================
Comment at: clang/test/CodeGen/attr-optimize.c:4
+
+__attribute__((optimize("O0"))) void f1(void) {}
+// O2: @f1{{.*}}[[ATTR_OPTNONE:#[0-9]+]]
----------------
xbolva00 wrote:
> No support for 
> ```
> __attribute__ ((__optimize__ (0)))
> ```
> 
> ? GCC supports it
Nope, I only added support for one argument and only strings. I think gcc supports expressions, multiple args, -f args, and -O args. I wasn't sure how to implement it in Attr.td without making heavy changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126984/new/

https://reviews.llvm.org/D126984



More information about the cfe-commits mailing list