[PATCH] D107025: Take OptimizationLevel class out of Pass Builder
Mircea Trofin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 28 21:28:53 PDT 2021
mtrofin added inline comments.
================
Comment at: llvm/include/llvm/Passes/OptimizationLevel.h:14
+//===----------------------------------------------------------------------===//
+
+class OptimizationLevel final {
----------------
this should be in the llvm namespace
================
Comment at: llvm/include/llvm/Passes/OptimizationLevel.h:15
+
+class OptimizationLevel final {
+ unsigned SpeedLevel = 2;
----------------
Make sure this has a header guard - i.e. a
#ifndef LLVM_PASSES_OPTIMIZATIONLEVEL_H
#define LLVM_PASSES_OPTIMIZATIONLEVEL_H
... the file
#endif
================
Comment at: llvm/include/llvm/Passes/OptimizationLevel.h:21
+ // Check that only valid combinations are passed.
+ assert(SpeedLevel <= 3 &&
+ "Optimization level for speed should be 0, 1, 2, or 3");
----------------
you're probably missing some #include; for assert, it's <assert.h>
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107025/new/
https://reviews.llvm.org/D107025
More information about the llvm-commits
mailing list