github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash git-clang-format --diff a080498c92e4c00f099dab1a3d5dac48f14b7492 9a3ff427202d1e4cf089732c73d07c2fc90d83da --extensions h,c,cpp -- clang/include/clang/Basic/Sanitizers.h clang/lib/Basic/Sanitizers.cpp clang/lib/CodeGen/BackendUtil.cpp clang/lib/CodeGen/CGExpr.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/test/CodeGen/allow-ubsan-check-inline.c clang/test/CodeGen/allow-ubsan-check.c `````````` </details> <details> <summary> View the diff from clang-format here. </summary> ``````````diff diff --git a/clang/lib/Basic/Sanitizers.cpp b/clang/lib/Basic/Sanitizers.cpp index a7d0cc73f1..1a6833b179 100644 --- a/clang/lib/Basic/Sanitizers.cpp +++ b/clang/lib/Basic/Sanitizers.cpp @@ -44,23 +44,23 @@ std::optional<double> SanitizerMaskCutoffs::operator[](unsigned Kind) const { void SanitizerMaskCutoffs::clear(SanitizerMask K) { set(K, 0); } -std::optional<std::vector<int>> SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { - std::vector<int> scaledCutoffs; - - bool anyNonZero = false; - for (unsigned int i = 0; i < SanitizerKind::SO_Count; ++i) { - int scaled = round((operator[](i)).value_or(0) * ScalingFactor); - scaledCutoffs.push_back(scaled); - anyNonZero |= (scaled != 0); - } +std::optional<std::vector<int>> +SanitizerMaskCutoffs::getAllScaled(int ScalingFactor) const { + std::vector<int> scaledCutoffs; + + bool anyNonZero = false; + for (unsigned int i = 0; i < SanitizerKind::SO_Count; ++i) { + int scaled = round((operator[](i)).value_or(0) * ScalingFactor); + scaledCutoffs.push_back(scaled); + anyNonZero |= (scaled != 0); + } - if (anyNonZero) - return scaledCutoffs; + if (anyNonZero) + return scaledCutoffs; - return std::nullopt; + return std::nullopt; } - // Once LLVM switches to C++17, the constexpr variables can be inline and we // won't need this. #define SANITIZER(NAME, ID) constexpr SanitizerMask SanitizerKind::ID; diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp index ef410fb53c..83d1f9b972 100644 --- a/clang/lib/CodeGen/BackendUtil.cpp +++ b/clang/lib/CodeGen/BackendUtil.cpp @@ -797,7 +797,8 @@ static void addSanitizers(const Triple &TargetTriple, // SanitizeSkipHotCutoffs: doubles with range [0, 1] // Opts.cutoffs: ints with range [0, 1000000] - std::optional<std::vector<int>> scaledCutoffs = CodeGenOpts.SanitizeSkipHotCutoffs.getAllScaled(1000000); + std::optional<std::vector<int>> scaledCutoffs = + CodeGenOpts.SanitizeSkipHotCutoffs.getAllScaled(1000000); // TODO: remove IsRequested() if (LowerAllowCheckPass::IsRequested() || scaledCutoffs.has_value()) { @@ -809,7 +810,8 @@ static void addSanitizers(const Triple &TargetTriple, if (scaledCutoffs.has_value()) { // Copy from std::vector<int> to std::vector<unsigned int> - Opts.cutoffs = {scaledCutoffs.value().begin(), scaledCutoffs.value().end()}; + Opts.cutoffs = {scaledCutoffs.value().begin(), + scaledCutoffs.value().end()}; } else { // TODO: remove this after we remove IsRequested() for (unsigned int i = 0; i < SanitizerKind::SO_Count; ++i) { `````````` </details> https://github.com/llvm/llvm-project/pull/124857 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits