diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-26 19:36:28 +0000 |
commit | cfca06d7963fa0909f90483b42a6d7d194d01e08 (patch) | |
tree | 209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/utils/TableGen/FastISelEmitter.cpp | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'llvm/utils/TableGen/FastISelEmitter.cpp')
-rw-r--r-- | llvm/utils/TableGen/FastISelEmitter.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/llvm/utils/TableGen/FastISelEmitter.cpp b/llvm/utils/TableGen/FastISelEmitter.cpp index b39956859fe8a..0729ab70d6966 100644 --- a/llvm/utils/TableGen/FastISelEmitter.cpp +++ b/llvm/utils/TableGen/FastISelEmitter.cpp @@ -414,7 +414,7 @@ private: } // End anonymous namespace static std::string getOpcodeName(Record *Op, CodeGenDAGPatterns &CGP) { - return CGP.getSDNodeInfo(Op).getEnumName(); + return std::string(CGP.getSDNodeInfo(Op).getEnumName()); } static std::string getLegalCName(std::string OpName) { @@ -719,22 +719,20 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) { MVT::SimpleValueType RetVT = RI->first; const PredMap &PM = RI->second; - OS << "unsigned fastEmit_" - << getLegalCName(Opcode) - << "_" << getLegalCName(getName(VT)) - << "_" << getLegalCName(getName(RetVT)) << "_"; + OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_" + << getLegalCName(std::string(getName(VT))) << "_" + << getLegalCName(std::string(getName(RetVT))) << "_"; Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "("; Operands.PrintParameters(OS); OS << ") {\n"; - emitInstructionCode(OS, Operands, PM, getName(RetVT)); + emitInstructionCode(OS, Operands, PM, std::string(getName(RetVT))); } // Emit one function for the type that demultiplexes on return type. - OS << "unsigned fastEmit_" - << getLegalCName(Opcode) << "_" - << getLegalCName(getName(VT)) << "_"; + OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_" + << getLegalCName(std::string(getName(VT))) << "_"; Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT RetVT"; if (!Operands.empty()) @@ -745,8 +743,9 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) { RI != RE; ++RI) { MVT::SimpleValueType RetVT = RI->first; OS << " case " << getName(RetVT) << ": return fastEmit_" - << getLegalCName(Opcode) << "_" << getLegalCName(getName(VT)) - << "_" << getLegalCName(getName(RetVT)) << "_"; + << getLegalCName(Opcode) << "_" + << getLegalCName(std::string(getName(VT))) << "_" + << getLegalCName(std::string(getName(RetVT))) << "_"; Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "("; Operands.PrintArguments(OS); @@ -756,9 +755,8 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) { } else { // Non-variadic return type. - OS << "unsigned fastEmit_" - << getLegalCName(Opcode) << "_" - << getLegalCName(getName(VT)) << "_"; + OS << "unsigned fastEmit_" << getLegalCName(Opcode) << "_" + << getLegalCName(std::string(getName(VT))) << "_"; Operands.PrintManglingSuffix(OS, ImmediatePredicates); OS << "(MVT RetVT"; if (!Operands.empty()) @@ -788,7 +786,7 @@ void FastISelMap::printFunctionDefinitions(raw_ostream &OS) { for (TypeRetPredMap::const_iterator TI = TM.begin(), TE = TM.end(); TI != TE; ++TI) { MVT::SimpleValueType VT = TI->first; - std::string TypeName = getName(VT); + std::string TypeName = std::string(getName(VT)); OS << " case " << TypeName << ": return fastEmit_" << getLegalCName(Opcode) << "_" << getLegalCName(TypeName) << "_"; Operands.PrintManglingSuffix(OS, ImmediatePredicates); |