1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[llvm] Drop unnecessary const from return types (NFC)

Identified with const-return-type.
This commit is contained in:
Kazu Hirata 2021-01-31 10:23:43 -08:00
parent 6bcccfc6ec
commit e0a8f45e5f
12 changed files with 15 additions and 20 deletions

View 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 {

View 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

View 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());
}

View 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; }

View 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:

View 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;

View 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;

View 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];
}

View 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;

View 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; }

View 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; }

View 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)