diff options
| author | Alexander Shaposhnikov <shal1t712@gmail.com> | 2017-07-05 20:14:54 +0000 |
|---|---|---|
| committer | Alexander Shaposhnikov <shal1t712@gmail.com> | 2017-07-05 20:14:54 +0000 |
| commit | d968f6f42377f6917b454b6508385f2f179b1f0c (patch) | |
| tree | 4e300133dc975f79aa0f3d29f84357192cc8f18e /llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | |
| parent | 8c4baa00de58e1f399cda78c5be5bd1fbb36c2b3 (diff) | |
| download | bcm5719-llvm-d968f6f42377f6917b454b6508385f2f179b1f0c.tar.gz bcm5719-llvm-d968f6f42377f6917b454b6508385f2f179b1f0c.zip | |
[tablegen] Avoid creating temporary strings
If a method / function returns a StringRef but the
variable is of type const std::string& a temporary string is
created (StringRef has a cast operator to std::string),
which is a suboptimal behavior.
Differential revision: https://reviews.llvm.org/D34994
Test plan: make check-all
llvm-svn: 307195
Diffstat (limited to 'llvm/utils/TableGen/FixedLenDecoderEmitter.cpp')
| -rw-r--r-- | llvm/utils/TableGen/FixedLenDecoderEmitter.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp index 75fd73082b9..03930d7132d 100644 --- a/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp +++ b/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp @@ -1691,9 +1691,7 @@ void FilterChooser::emitTableEntries(DecoderTableInfo &TableInfo) const { dumpStack(errs(), "\t\t"); for (unsigned i = 0; i < Opcodes.size(); ++i) { - const std::string &Name = nameWithID(Opcodes[i]); - - errs() << '\t' << Name << " "; + errs() << '\t' << nameWithID(Opcodes[i]) << " "; dumpBits(errs(), getBitsField(*AllInstructions[Opcodes[i]]->TheDef, "Inst")); errs() << '\n'; |

