diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-07-31 21:22:58 +0000 | 
| commit | 5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch) | |
| tree | 0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp | |
| parent | 1799696096df87b52968b8996d00c91e0a5de8d9 (diff) | |
| parent | cfca06d7963fa0909f90483b42a6d7d194d01e08 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp | 28 | 
1 files changed, 13 insertions, 15 deletions
diff --git a/contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp b/contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp index b39956859fe8..0729ab70d696 100644 --- a/contrib/llvm-project/llvm/utils/TableGen/FastISelEmitter.cpp +++ b/contrib/llvm-project/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);  | 
