[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 3 11:34:35 PDT 2022


steplong created this revision.
Herald added a reviewer: aaron.ballman.
Herald added a project: All.
steplong requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

At the moment, it only supports a string argument that refers to
the optimization level. "-f" arguments aren't supported. The argument
must begin with "O" or "-O". Also, only non-negative optimization levels
and "-Os" are accepted.

Only "-Os" and "-O0" currently affect codegen.

i.e. __attribute__((optimize("O0")))


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126984

Files:
  clang/include/clang/Basic/Attr.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/CodeGen/CodeGenModule.cpp
  clang/lib/CodeGen/CodeGenModule.h
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CodeGen/attr-optimize.c
  clang/test/Sema/attr-optimize.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126984.434083.patch
Type: text/x-patch
Size: 9704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220603/b3d4cf4f/attachment.bin>


More information about the cfe-commits mailing list