aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringMap.cpp
diff options
context:
space:
mode:
authorChris Lattner <clattner@nondot.org>2020-04-11 18:15:56 -0700
committerChris Lattner <clattner@nondot.org>2020-04-11 21:48:52 -0700
commit0031c7f7dab5489934fc97c783fedbd49a377323 (patch)
tree57d9241dd34fe3d87756d757b260c86e4d214002 /llvm/lib/Support/StringMap.cpp
parent5b423990297583f158e0e59f4dd208fbd158addb (diff)
downloadllvm-0031c7f7dab5489934fc97c783fedbd49a377323.zip
llvm-0031c7f7dab5489934fc97c783fedbd49a377323.tar.gz
llvm-0031c7f7dab5489934fc97c783fedbd49a377323.tar.bz2
Implement some micro-optimizations for Identifier. NFC
Summary: Identifier doesn't maintain a length, so every time strref() is called, it does a strlen. In the case of comparisons, this isn't necessary: there is no need to scan a string to get its length, then rescan it to do the comparison. Just done one comparison. This also moves some assertions in Identifier::get as another microoptimization for 'assertions enabled' modes. Reviewers: rriddle! Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77958
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
0 files changed, 0 insertions, 0 deletions