[PATCH] D125723: [MSVC] Add support for MSVC pragma optimize
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 31 08:19:46 PDT 2022
aaron.ballman added inline comments.
================
Comment at: clang/lib/Sema/SemaAttr.cpp:1207-1213
+ FD->addAttr(FramePointerAttr::CreateImplicit(Context, Kind));
+}
+
+void Sema::AddOptsize(FunctionDecl *FD, SourceLocation Loc) {
+ FD->dropAttr<OptimizeSizeAttr>();
+ OptimizeSizeAttr::Kind Kind = OptimizeSizeAttr::On;
+ FD->addAttr(OptimizeSizeAttr::CreateImplicit(Context, Kind));
----------------
Rather than creating two new, implicit attributes for this, why not add support for `__attribute__((optimize(...)))` from GCC and reuse that one?
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
It seems like that serves the same function as these implicit attributes, but then users would get two features for the price of one.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125723/new/
https://reviews.llvm.org/D125723
More information about the cfe-commits
mailing list