[PATCH] D44630: [ms] Parse #pragma optimize and ignore it behind its own flag

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 20 01:57:50 PDT 2018


hans marked an inline comment as done.
hans added inline comments.


================
Comment at: include/clang/Basic/DiagnosticParseKinds.td:973
+def warn_pragma_optimize : Warning<
+  "'#pragma optimize' is not supported; use '#pragma clang optimize on|off' instead">,
+  InGroup<IgnoredPragmaOptimize>;
----------------
thakis wrote:
> Is `pragma clang optimize` really what we want to recommend here? `pragma optimize` is used in practice mostly to work around cl.exe compiler bugs, or to disable inlining. In neither case, `pragma clang optimize` is what you'd really want to use. Maybe just omit everything after ; and instead add a blurb about this in DiagnosticDocs.td ?
I'll drop the suggestion for now.

Turns out it was not so easy to get a blurb into DiagnosticDocs or DiagnosticsReference. They're auto-generated but don't seem to have a good way to enter extra documentation. I'll just leave it for now.


https://reviews.llvm.org/D44630





More information about the cfe-commits mailing list