diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-11-24 15:36:17 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-11-24 15:36:17 +0000 |
| commit | 6ca15b6114d3c0e3154414346ddaf2cc75ca944a (patch) | |
| tree | aeba3cb34227a92f901f61a76cb270383d6c44c5 /clang/lib | |
| parent | f1ee930db0cf05d3395f9d50324c64ca85b45f82 (diff) | |
| download | bcm5719-llvm-6ca15b6114d3c0e3154414346ddaf2cc75ca944a.tar.gz bcm5719-llvm-6ca15b6114d3c0e3154414346ddaf2cc75ca944a.zip | |
[Sema] Pass APSInts by const ref, avoiding copies.
No functionality change intended. Fix by clang-tidy's
performance-unnecessary-value-param check.
llvm-svn: 287890
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index a702d6aaeec..c14734182fa 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -814,7 +814,7 @@ Sema::ActOnDecompositionDeclarator(Scope *S, Declarator &D, static bool checkSimpleDecomposition( Sema &S, ArrayRef<BindingDecl *> Bindings, ValueDecl *Src, - QualType DecompType, llvm::APSInt NumElems, QualType ElemType, + QualType DecompType, const llvm::APSInt &NumElems, QualType ElemType, llvm::function_ref<ExprResult(SourceLocation, Expr *, unsigned)> GetInit) { if ((int64_t)Bindings.size() != NumElems) { S.Diag(Src->getLocation(), diag::err_decomp_decl_wrong_number_bindings) @@ -841,7 +841,7 @@ static bool checkSimpleDecomposition( static bool checkArrayLikeDecomposition(Sema &S, ArrayRef<BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, - llvm::APSInt NumElems, + const llvm::APSInt &NumElems, QualType ElemType) { return checkSimpleDecomposition( S, Bindings, Src, DecompType, NumElems, ElemType, @@ -1064,7 +1064,7 @@ struct BindingDiagnosticTrap { static bool checkTupleLikeDecomposition(Sema &S, ArrayRef<BindingDecl *> Bindings, VarDecl *Src, QualType DecompType, - llvm::APSInt TupleSize) { + const llvm::APSInt &TupleSize) { if ((int64_t)Bindings.size() != TupleSize) { S.Diag(Src->getLocation(), diag::err_decomp_decl_wrong_number_bindings) << DecompType << (unsigned)Bindings.size() << TupleSize.toString(10) |

