diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-03-21 21:35:04 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-03-21 21:35:04 +0000 |
commit | 3c892b9138e4d2de073529c85f51c76b71913383 (patch) | |
tree | 75565ba4a9e7fef1165f463d01068180df6bba65 /lib/AST/ExprConstant.cpp | |
parent | eb0cd97d1203435dc852d720887566aeb737dc8a (diff) |
Apply clang-tidy's performance-unnecessary-value-param to parts of clang.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298443 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index a1b508f78c..2fafa48767 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -350,7 +350,8 @@ namespace { MostDerivedArraySize = 2; MostDerivedPathLength = Entries.size(); } - void diagnosePointerArithmetic(EvalInfo &Info, const Expr *E, APSInt N); + void diagnosePointerArithmetic(EvalInfo &Info, const Expr *E, + const APSInt &N); /// Add N to the address of this subobject. void adjustIndex(EvalInfo &Info, const Expr *E, APSInt N) { if (Invalid || !N) return; @@ -1071,7 +1072,8 @@ bool SubobjectDesignator::checkSubobject(EvalInfo &Info, const Expr *E, } void SubobjectDesignator::diagnosePointerArithmetic(EvalInfo &Info, - const Expr *E, APSInt N) { + const Expr *E, + const APSInt &N) { // If we're complaining, we must be able to statically determine the size of // the most derived array. if (MostDerivedPathLength == Entries.size() && MostDerivedIsArrayElement) @@ -1296,8 +1298,8 @@ namespace { void clearIsNullPointer() { IsNullPtr = false; } - void adjustOffsetAndIndex(EvalInfo &Info, const Expr *E, APSInt Index, - CharUnits ElementSize) { + void adjustOffsetAndIndex(EvalInfo &Info, const Expr *E, + const APSInt &Index, CharUnits ElementSize) { // An index of 0 has no effect. (In C, adding 0 to a null pointer is UB, // but we're not required to diagnose it and it's valid in C++.) if (!Index) @@ -8072,7 +8074,8 @@ bool DataRecursiveIntBinOpEvaluator:: return true; } -static void addOrSubLValueAsInteger(APValue &LVal, APSInt Index, bool IsSub) { +static void addOrSubLValueAsInteger(APValue &LVal, const APSInt &Index, + bool IsSub) { // Compute the new offset in the appropriate width, wrapping at 64 bits. // FIXME: When compiling for a 32-bit target, we should use 32-bit // offsets. |