Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang-tools-extra/clang-tidy/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Checks: >
performance-*,
-performance-enum-size,
-performance-no-int-to-ptr,
-performance-type-promotion-in-math-fn,
-performance-unnecessary-value-param,
readability-*,
-readability-avoid-nested-conditional-operator,
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ void StructPackAlignCheck::check(const MatchFinder::MatchResult &Result) {
CharUnits CurrSize = Result.Context->getASTRecordLayout(Struct).getSize();
CharUnits MinByteSize =
CharUnits::fromQuantity(std::max<clang::CharUnits::QuantityType>(
ceil(static_cast<float>(TotalBitSize) / CharSize), 1));
std::ceil(static_cast<float>(TotalBitSize) / CharSize), 1));
CharUnits MaxAlign = CharUnits::fromQuantity(
ceil((float)Struct->getMaxAlignment() / CharSize));
std::ceil((float)Struct->getMaxAlignment() / CharSize));
CharUnits CurrAlign =
Result.Context->getASTRecordLayout(Struct).getAlignment();
CharUnits NewAlign = computeRecommendedAlignment(MinByteSize);
Expand Down
14 changes: 8 additions & 6 deletions clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,20 @@ bool UnrollLoopsCheck::hasLargeNumIterations(const Stmt *Statement,
return true;
switch (Op->getOpcode()) {
case (BO_AddAssign):
Iterations = ceil(float(EndValue - InitValue) / ConstantValue);
Iterations = std::ceil(float(EndValue - InitValue) / ConstantValue);
break;
case (BO_SubAssign):
Iterations = ceil(float(InitValue - EndValue) / ConstantValue);
Iterations = std::ceil(float(InitValue - EndValue) / ConstantValue);
break;
case (BO_MulAssign):
Iterations = 1 + (log((double)EndValue) - log((double)InitValue)) /
log((double)ConstantValue);
Iterations =
1 + (std::log((double)EndValue) - std::log((double)InitValue)) /
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no type promotion with these logs, but I figured it's still better to std::-qualify them for consistency

std::log((double)ConstantValue);
break;
case (BO_DivAssign):
Iterations = 1 + (log((double)InitValue) - log((double)EndValue)) /
log((double)ConstantValue);
Iterations =
1 + (std::log((double)InitValue) - std::log((double)EndValue)) /
std::log((double)ConstantValue);
break;
default:
// All other operators are not handled; assume large bounds.
Expand Down