diff --git a/clang/lib/CodeGen/CGGPUBuiltin.cpp b/clang/lib/CodeGen/CGGPUBuiltin.cpp --- a/clang/lib/CodeGen/CGGPUBuiltin.cpp +++ b/clang/lib/CodeGen/CGGPUBuiltin.cpp @@ -125,7 +125,7 @@ } } -bool containsNonScalarVarargs(CodeGenFunction *CGF, CallArgList Args) { +bool containsNonScalarVarargs(CodeGenFunction *CGF, const CallArgList &Args) { return llvm::any_of(llvm::drop_begin(Args), [&](const CallArg &A) { return !A.getRValue(*CGF).isScalar(); }); diff --git a/clang/lib/CodeGen/CGNonTrivialStruct.cpp b/clang/lib/CodeGen/CGNonTrivialStruct.cpp --- a/clang/lib/CodeGen/CGNonTrivialStruct.cpp +++ b/clang/lib/CodeGen/CGNonTrivialStruct.cpp @@ -323,7 +323,7 @@ template static std::array getParamAddrs(std::index_sequence IntSeq, std::array Alignments, - FunctionArgList Args, + const FunctionArgList &Args, CodeGenFunction *CGF) { return std::array{ {Address(CGF->Builder.CreateLoad(CGF->GetAddrOfLocalVar(Args[Ints])), diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1711,7 +1711,7 @@ /// Emit the module flag metadata used to pass options controlling the /// the backend to LLVM. - void EmitBackendOptionsMetadata(const CodeGenOptions CodeGenOpts); + void EmitBackendOptionsMetadata(const CodeGenOptions &CodeGenOpts); /// Emits OpenCL specific Metadata e.g. OpenCL version. void EmitOpenCLMetadata(); diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -990,7 +990,7 @@ } void CodeGenModule::EmitBackendOptionsMetadata( - const CodeGenOptions CodeGenOpts) { + const CodeGenOptions &CodeGenOpts) { if (getTriple().isRISCV()) { getModule().addModuleFlag(llvm::Module::Min, "SmallDataLimit", CodeGenOpts.SmallDataLimit); diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -4553,7 +4553,7 @@ return false; } -static bool IsNoDerefableChunk(DeclaratorChunk Chunk) { +static bool IsNoDerefableChunk(const DeclaratorChunk &Chunk) { return (Chunk.Kind == DeclaratorChunk::Pointer || Chunk.Kind == DeclaratorChunk::Array); }