[clang] [clang] Implement -fstrict-bool (PR #160790)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 07:59:07 PDT 2026


=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>,
=?utf-8?q?Félix?= Cloutier <fcloutier at apple.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/160790 at github.com>


================
@@ -663,6 +673,22 @@ class CodeGenOptions : public CodeGenOptionsBase {
   bool isLoaderReplaceableFunctionName(StringRef FuncName) const {
     return llvm::is_contained(LoaderReplaceableFunctionNames, FuncName);
   }
+
+  /// Are we building at -O1 or higher?
+  bool isOptimizedBuild() const { return OptimizationLevel > 0; }
----------------
cor3ntin wrote:

In a follow up, you could do a search of replace of `OptimizationLevel > 0` by that new function

https://github.com/llvm/llvm-project/pull/160790


More information about the cfe-commits mailing list