[llvm] Drop unnecessary const from return types (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 31 Jan 2021 18:23:43 +0000 (10:23 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 31 Jan 2021 18:23:43 +0000 (10:23 -0800)
Identified with const-return-type.

12 files changed:
llvm/include/llvm/Analysis/DDG.h
llvm/include/llvm/Analysis/LoopCacheAnalysis.h
llvm/include/llvm/IR/DerivedTypes.h
llvm/include/llvm/MCA/Instruction.h
llvm/include/llvm/Object/WindowsResource.h
llvm/include/llvm/TableGen/DirectiveEmitter.h
llvm/include/llvm/Transforms/IPO/SampleContextTracker.h
llvm/lib/Target/X86/X86MachineFunctionInfo.h
llvm/lib/Transforms/IPO/SampleContextTracker.cpp
llvm/tools/dsymutil/DebugMap.h
llvm/tools/llvm-profgen/ProfiledBinary.h
llvm/tools/llvm-readobj/ELFDumper.cpp

index e3bef33..5317b6e 100644 (file)
@@ -275,7 +275,7 @@ public:
   virtual ~DependenceGraphInfo() {}
 
   /// Return the label that is used to name this graph.
-  const StringRef getName() const { return Name; }
+  StringRef getName() const { return Name; }
 
   /// Return the root node of the graph.
   NodeType &getRoot() const {
index e8f2205..21882eb 100644 (file)
@@ -205,7 +205,7 @@ public:
   }
 
   /// Return the estimated ordered loop costs.
-  const ArrayRef<LoopCacheCostTy> getLoopCosts() const { return LoopCosts; }
+  ArrayRef<LoopCacheCostTy> getLoopCosts() const { return LoopCosts; }
 
 private:
   /// Calculate the cache footprint of each loop in the nest (when it is
index 4c89fc0..41814d5 100644 (file)
@@ -318,7 +318,7 @@ public:
 
   element_iterator element_begin() const { return ContainedTys; }
   element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
-  ArrayRef<Type *> const elements() const {
+  ArrayRef<Type *> elements() const {
     return makeArrayRef(element_begin(), element_end());
   }
 
index c97cb46..1e08957 100644 (file)
@@ -412,9 +412,9 @@ public:
   InstructionBase(const InstrDesc &D) : Desc(D), IsOptimizableMove(false) {}
 
   SmallVectorImpl<WriteState> &getDefs() { return Defs; }
-  const ArrayRef<WriteState> getDefs() const { return Defs; }
+  ArrayRef<WriteState> getDefs() const { return Defs; }
   SmallVectorImpl<ReadState> &getUses() { return Uses; }
-  const ArrayRef<ReadState> getUses() const { return Uses; }
+  ArrayRef<ReadState> getUses() const { return Uses; }
   const InstrDesc &getDesc() const { return Desc; }
 
   unsigned getLatency() const { return Desc.MaxLatency; }
index a0d6584..7889928 100644 (file)
@@ -160,10 +160,8 @@ public:
   void cleanUpManifests(std::vector<std::string> &Duplicates);
   void printTree(raw_ostream &OS) const;
   const TreeNode &getTree() const { return Root; }
-  const ArrayRef<std::vector<uint8_t>> getData() const { return Data; }
-  const ArrayRef<std::vector<UTF16>> getStringTable() const {
-    return StringTable;
-  }
+  ArrayRef<std::vector<uint8_t>> getData() const { return Data; }
+  ArrayRef<std::vector<UTF16>> getStringTable() const { return StringTable; }
 
   class TreeNode {
   public:
index 27ad066..8f88802 100644 (file)
@@ -93,7 +93,7 @@ public:
   bool isDefault() const { return Def->getValueAsBit("isDefault"); }
 
   // Returns the record name.
-  const StringRef getRecordName() const { return Def->getName(); }
+  StringRef getRecordName() const { return Def->getName(); }
 
 protected:
   const llvm::Record *Def;
index 5b26001..e352134 100644 (file)
@@ -53,7 +53,7 @@ public:
                                       bool DeleteNode = true);
   void removeChildContext(const LineLocation &CallSite, StringRef CalleeName);
   std::map<uint32_t, ContextTrieNode> &getAllChildContext();
-  const StringRef getFuncName() const;
+  StringRef getFuncName() const;
   FunctionSamples *getFunctionSamples() const;
   void setFunctionSamples(FunctionSamples *FSamples);
   LineLocation getCallSiteLoc() const;
index eedad95..ecb86bb 100644 (file)
@@ -219,7 +219,7 @@ public:
     PreallocatedArgOffsets[Id].assign(AO.begin(), AO.end());
   }
 
-  const ArrayRef<size_t> getPreallocatedArgOffsets(const size_t Id) {
+  ArrayRef<size_t> getPreallocatedArgOffsets(const size_t Id) {
     assert(!PreallocatedArgOffsets[Id].empty() && "arg offsets not set");
     return PreallocatedArgOffsets[Id];
   }
index 660d79d..2327b93 100644 (file)
@@ -113,7 +113,7 @@ std::map<uint32_t, ContextTrieNode> &ContextTrieNode::getAllChildContext() {
   return AllChildContext;
 }
 
-const StringRef ContextTrieNode::getFuncName() const { return FuncName; }
+StringRef ContextTrieNode::getFuncName() const { return FuncName; }
 
 FunctionSamples *ContextTrieNode::getFunctionSamples() const {
   return FuncSamples;
index ee552ed..e4fbaa8 100644 (file)
@@ -114,9 +114,7 @@ public:
 
   const Triple &getTriple() const { return BinaryTriple; }
 
-  const ArrayRef<uint8_t> getUUID() const {
-    return ArrayRef<uint8_t>(BinaryUUID);
-  }
+  ArrayRef<uint8_t> getUUID() const { return ArrayRef<uint8_t>(BinaryUUID); }
 
   StringRef getBinaryPath() const { return BinaryPath; }
 
index bb028da..87fdf4b 100644 (file)
@@ -179,8 +179,8 @@ public:
   uint64_t offsetToVirtualAddr(uint64_t Offset) const {
     return Offset + BaseAddress;
   }
-  const StringRef getPath() const { return Path; }
-  const StringRef getName() const { return llvm::sys::path::filename(Path); }
+  StringRef getPath() const { return Path; }
+  StringRef getName() const { return llvm::sys::path::filename(Path); }
   uint64_t getBaseAddress() const { return BaseAddress; }
   void setBaseAddress(uint64_t Address) { BaseAddress = Address; }
   uint64_t getPreferredBaseAddress() const { return PreferredBaseAddress; }
index 0f508f8..4f6e984 100644 (file)
@@ -5141,8 +5141,7 @@ static const NoteType CoreNoteTypes[] = {
 };
 
 template <class ELFT>
-const StringRef getNoteTypeName(const typename ELFT::Note &Note,
-                                unsigned ELFType) {
+StringRef getNoteTypeName(const typename ELFT::Note &Note, unsigned ELFType) {
   uint32_t Type = Note.getType();
   auto FindNote = [&](ArrayRef<NoteType> V) -> StringRef {
     for (const NoteType &N : V)