From 6504f57e9395cb01ce97980ebed5ad4e596cae78 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 27 Aug 2014 06:28:16 +0000 Subject: [PATCH] Fix some cases were ArrayRefs were being passed by reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216527 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Decl.h | 2 +- lib/AST/VTableBuilder.cpp | 2 +- lib/CodeGen/CGStmt.cpp | 10 +++++----- lib/CodeGen/CodeGenFunction.h | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 083183525c..6b5dea1287 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1881,7 +1881,7 @@ public: return llvm::makeArrayRef(ParamInfo, getNumParams()); } - const ArrayRef &getDeclsInPrototypeScope() const { + ArrayRef getDeclsInPrototypeScope() const { return DeclsInPrototypeScope; } void setDeclsInPrototypeScope(ArrayRef NewDecls); diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index c03fb3244d..3d29b5ea8d 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -3129,7 +3129,7 @@ void VFTableBuilder::dumpLayout(raw_ostream &Out) { } static bool setsIntersect(const llvm::SmallPtrSet &A, - const ArrayRef &B) { + ArrayRef B) { for (ArrayRef::iterator I = B.begin(), E = B.end(); I != E; ++I) { if (A.count(*I)) diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index d8681d480f..9400b38348 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -573,7 +573,7 @@ void CodeGenFunction::EmitIfStmt(const IfStmt &S) { void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context, llvm::BranchInst *CondBr, - const ArrayRef &Attrs) { + ArrayRef Attrs) { // Return if there are no hints. if (Attrs.empty()) return; @@ -656,7 +656,7 @@ void CodeGenFunction::EmitCondBrHints(llvm::LLVMContext &Context, } void CodeGenFunction::EmitWhileStmt(const WhileStmt &S, - const ArrayRef &WhileAttrs) { + ArrayRef WhileAttrs) { RegionCounter Cnt = getPGORegionCounter(&S); // Emit the header for the loop, which will also become @@ -746,7 +746,7 @@ void CodeGenFunction::EmitWhileStmt(const WhileStmt &S, } void CodeGenFunction::EmitDoStmt(const DoStmt &S, - const ArrayRef &DoAttrs) { + ArrayRef DoAttrs) { JumpDest LoopExit = getJumpDestInCurrentScope("do.end"); JumpDest LoopCond = getJumpDestInCurrentScope("do.cond"); @@ -807,7 +807,7 @@ void CodeGenFunction::EmitDoStmt(const DoStmt &S, } void CodeGenFunction::EmitForStmt(const ForStmt &S, - const ArrayRef &ForAttrs) { + ArrayRef ForAttrs) { JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); @@ -908,7 +908,7 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S, void CodeGenFunction::EmitCXXForRangeStmt(const CXXForRangeStmt &S, - const ArrayRef &ForAttrs) { + ArrayRef ForAttrs) { JumpDest LoopExit = getJumpDestInCurrentScope("for.end"); LexicalScope ForScope(*this, S.getSourceRange()); diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 9c62631dbb..3281f0b517 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -1893,12 +1893,12 @@ public: void EmitIfStmt(const IfStmt &S); void EmitCondBrHints(llvm::LLVMContext &Context, llvm::BranchInst *CondBr, - const ArrayRef &Attrs); + ArrayRef Attrs); void EmitWhileStmt(const WhileStmt &S, - const ArrayRef &Attrs = None); - void EmitDoStmt(const DoStmt &S, const ArrayRef &Attrs = None); + ArrayRef Attrs = None); + void EmitDoStmt(const DoStmt &S, ArrayRef Attrs = None); void EmitForStmt(const ForStmt &S, - const ArrayRef &Attrs = None); + ArrayRef Attrs = None); void EmitReturnStmt(const ReturnStmt &S); void EmitDeclStmt(const DeclStmt &S); void EmitBreakStmt(const BreakStmt &S); @@ -1922,7 +1922,7 @@ public: void EmitSEHTryStmt(const SEHTryStmt &S); void EmitSEHLeaveStmt(const SEHLeaveStmt &S); void EmitCXXForRangeStmt(const CXXForRangeStmt &S, - const ArrayRef &Attrs = None); + ArrayRef Attrs = None); llvm::Function *EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K); llvm::Function *GenerateCapturedStmtFunction(const CapturedStmt &S); -- 2.40.0