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 | f6021ecddc73d14c94ad70938250d58f330795be (patch) | |
tree | fca32d01f410767901dd63e95e4dae78e1fbf81c /clang/lib/AST/ExprConstant.cpp | |
parent | a079cdbeb80500c85ba8eb9d539528e4c19f9da1 (diff) | |
download | bcm5719-llvm-f6021ecddc73d14c94ad70938250d58f330795be.tar.gz bcm5719-llvm-f6021ecddc73d14c94ad70938250d58f330795be.zip |
Apply clang-tidy's performance-unnecessary-value-param to parts of clang.
No functionality change intended.
llvm-svn: 298443
Diffstat (limited to 'clang/lib/AST/ExprConstant.cpp')
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index a1b508f78cd..2fafa487675 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/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. |