From 16edb0e930639c566b27b8224d86a6e72dd10d9c Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 27 Aug 2014 05:25:00 +0000 Subject: [PATCH] Fix some cases were ArrayRefs were being passed by reference. Also remove 'const' from some other ArrayRef uses since its implicitly const already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216524 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LTO/LTOCodeGenerator.h | 2 +- lib/CodeGen/AsmPrinter/DebugLocEntry.h | 2 +- lib/LTO/LTOCodeGenerator.cpp | 2 +- lib/Transforms/Instrumentation/AddressSanitizer.cpp | 8 ++++---- utils/TableGen/CodeGenRegisters.cpp | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/llvm/LTO/LTOCodeGenerator.h b/include/llvm/LTO/LTOCodeGenerator.h index f843f18c67f..67b8903feb7 100644 --- a/include/llvm/LTO/LTOCodeGenerator.h +++ b/include/llvm/LTO/LTOCodeGenerator.h @@ -122,7 +122,7 @@ private: bool generateObjectFile(raw_ostream &out, bool disableOpt, bool disableInline, bool disableGVNLoadPRE, std::string &errMsg); void applyScopeRestrictions(); - void applyRestriction(GlobalValue &GV, const ArrayRef &Libcalls, + void applyRestriction(GlobalValue &GV, ArrayRef Libcalls, std::vector &MustPreserveList, SmallPtrSetImpl &AsmUsed, Mangler &Mangler); diff --git a/lib/CodeGen/AsmPrinter/DebugLocEntry.h b/lib/CodeGen/AsmPrinter/DebugLocEntry.h index eae150acbfb..6af049ad683 100644 --- a/lib/CodeGen/AsmPrinter/DebugLocEntry.h +++ b/lib/CodeGen/AsmPrinter/DebugLocEntry.h @@ -118,7 +118,7 @@ public: const MCSymbol *getBeginSym() const { return Begin; } const MCSymbol *getEndSym() const { return End; } - const ArrayRef getValues() const { return Values; } + ArrayRef getValues() const { return Values; } void addValues(ArrayRef Vals) { Values.append(Vals.begin(), Vals.end()); sortUniqueValues(); diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index 54f5a6b4c50..887fddefc57 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -312,7 +312,7 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) { void LTOCodeGenerator:: applyRestriction(GlobalValue &GV, - const ArrayRef &Libcalls, + ArrayRef Libcalls, std::vector &MustPreserveList, SmallPtrSetImpl &AsmUsed, Mangler &Mangler) { diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 02d68d4e7ee..357b5d52608 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -378,7 +378,7 @@ struct AddressSanitizer : public FunctionPass { bool LooksLikeCodeInBug11395(Instruction *I); bool GlobalIsLinkerInitialized(GlobalVariable *G); - bool InjectCoverage(Function &F, const ArrayRef AllBlocks); + bool InjectCoverage(Function &F, ArrayRef AllBlocks); void InjectCoverageAtBlock(Function &F, BasicBlock &BB); LLVMContext *C; @@ -562,7 +562,7 @@ struct FunctionStackPoisoner : public InstVisitor { } /// Finds alloca where the value comes from. AllocaInst *findAllocaForValue(Value *V); - void poisonRedZones(const ArrayRef ShadowBytes, IRBuilder<> &IRB, + void poisonRedZones(ArrayRef ShadowBytes, IRBuilder<> &IRB, Value *ShadowBase, bool DoPoison); void poisonAlloca(Value *V, uint64_t Size, IRBuilder<> &IRB, bool DoPoison); @@ -1352,7 +1352,7 @@ void AddressSanitizer::InjectCoverageAtBlock(Function &F, BasicBlock &BB) { // a) get the functionality to users earlier and // b) collect usage statistics to help improve Clang coverage design. bool AddressSanitizer::InjectCoverage(Function &F, - const ArrayRef AllBlocks) { + ArrayRef AllBlocks) { if (!ClCoverage) return false; if (ClCoverage == 1 || @@ -1527,7 +1527,7 @@ void FunctionStackPoisoner::initializeCallbacks(Module &M) { } void -FunctionStackPoisoner::poisonRedZones(const ArrayRef ShadowBytes, +FunctionStackPoisoner::poisonRedZones(ArrayRef ShadowBytes, IRBuilder<> &IRB, Value *ShadowBase, bool DoPoison) { size_t n = ShadowBytes.size(); diff --git a/utils/TableGen/CodeGenRegisters.cpp b/utils/TableGen/CodeGenRegisters.cpp index 5de2ee7b229..dd3442bcc4b 100644 --- a/utils/TableGen/CodeGenRegisters.cpp +++ b/utils/TableGen/CodeGenRegisters.cpp @@ -1532,7 +1532,7 @@ void CodeGenRegBank::computeRegUnitSets() { assert(RegUnitSets.empty() && "dirty RegUnitSets"); // Compute a unique RegUnitSet for each RegClass. - const ArrayRef &RegClasses = getRegClasses(); + ArrayRef RegClasses = getRegClasses(); unsigned NumRegClasses = RegClasses.size(); for (unsigned RCIdx = 0, RCEnd = NumRegClasses; RCIdx != RCEnd; ++RCIdx) { if (!RegClasses[RCIdx]->Allocatable) -- 2.34.1