1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[TableGen] Drop redundant const from return types (NFC)

Identified with readability-const-return-type.
This commit is contained in:
Kazu Hirata 2021-01-17 10:39:48 -08:00
parent ceea2ccdb5
commit dd2009efe4
7 changed files with 14 additions and 17 deletions

View File

@ -196,7 +196,7 @@ void CodeGenRegister::buildObjectGraph(CodeGenRegBank &RegBank) {
}
}
const StringRef CodeGenRegister::getName() const {
StringRef CodeGenRegister::getName() const {
assert(TheDef && "no def");
return TheDef->getName();
}

View File

@ -163,7 +163,7 @@ namespace llvm {
CodeGenRegister(Record *R, unsigned Enum);
const StringRef getName() const;
StringRef getName() const;
// Extract more information from TheDef. This is used to build an object
// graph after all CodeGenRegister objects have been created.

View File

@ -260,9 +260,7 @@ CodeGenTarget::CodeGenTarget(RecordKeeper &records)
CodeGenTarget::~CodeGenTarget() {
}
const StringRef CodeGenTarget::getName() const {
return TargetRec->getName();
}
StringRef CodeGenTarget::getName() const { return TargetRec->getName(); }
/// getInstNamespace - Find and return the target machine's instruction
/// namespace. The namespace is cached because it is requested multiple times.

View File

@ -68,7 +68,7 @@ public:
~CodeGenTarget();
Record *getTargetRecord() const { return TargetRec; }
const StringRef getName() const;
StringRef getName() const;
/// getInstNamespace - Return the target-specific instruction namespace.
///

View File

@ -706,7 +706,7 @@ public:
const ComplexPattern &getPattern() const { return Pattern; }
unsigned getMatchNumber() const { return MatchNumber; }
const std::string getName() const { return Name; }
std::string getName() const { return Name; }
unsigned getFirstResult() const { return FirstResult; }
static bool classof(const Matcher *N) {

View File

@ -1582,7 +1582,7 @@ public:
AllocatedTemporariesBaseID(AllocatedTemporariesBaseID) {}
bool hasSymbolicName() const { return !SymbolicName.empty(); }
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void setSymbolicName(StringRef Name) {
assert(SymbolicName.empty() && "Operand already has a symbolic name");
SymbolicName = std::string(Name);
@ -2536,7 +2536,7 @@ public:
return R->getKind() == OR_Copy;
}
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void emitRenderOpcodes(MatchTable &Table, RuleMatcher &Rule) const override {
const OperandMatcher &Operand = Rule.getOperandMatcher(SymbolicName);
@ -2603,7 +2603,7 @@ public:
return R->getKind() == OR_CopyOrAddZeroReg;
}
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void emitRenderOpcodes(MatchTable &Table, RuleMatcher &Rule) const override {
const OperandMatcher &Operand = Rule.getOperandMatcher(SymbolicName);
@ -2640,7 +2640,7 @@ public:
return R->getKind() == OR_CopyConstantAsImm;
}
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void emitRenderOpcodes(MatchTable &Table, RuleMatcher &Rule) const override {
InstructionMatcher &InsnMatcher = Rule.getInstructionMatcher(SymbolicName);
@ -2671,7 +2671,7 @@ public:
return R->getKind() == OR_CopyFConstantAsFPImm;
}
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void emitRenderOpcodes(MatchTable &Table, RuleMatcher &Rule) const override {
InstructionMatcher &InsnMatcher = Rule.getInstructionMatcher(SymbolicName);
@ -2705,7 +2705,7 @@ public:
return R->getKind() == OR_CopySubReg;
}
const StringRef getSymbolicName() const { return SymbolicName; }
StringRef getSymbolicName() const { return SymbolicName; }
void emitRenderOpcodes(MatchTable &Table, RuleMatcher &Rule) const override {
const OperandMatcher &Operand = Rule.getOperandMatcher(SymbolicName);

View File

@ -20,7 +20,7 @@
using namespace llvm;
static const std::string getOptionName(const Record &R) {
static std::string getOptionName(const Record &R) {
// Use the record name unless EnumName is defined.
if (isa<UnsetInit>(R.getValueInit("EnumName")))
return std::string(R.getName());
@ -35,8 +35,7 @@ static raw_ostream &write_cstring(raw_ostream &OS, llvm::StringRef Str) {
return OS;
}
static const std::string getOptionSpelling(const Record &R,
size_t &PrefixLength) {
static std::string getOptionSpelling(const Record &R, size_t &PrefixLength) {
std::vector<StringRef> Prefixes = R.getValueAsListOfStrings("Prefixes");
StringRef Name = R.getValueAsString("Name");
@ -49,7 +48,7 @@ static const std::string getOptionSpelling(const Record &R,
return (Twine(Prefixes[0]) + Twine(Name)).str();
}
static const std::string getOptionSpelling(const Record &R) {
static std::string getOptionSpelling(const Record &R) {
size_t PrefixLength;
return getOptionSpelling(R, PrefixLength);
}