td_type is std::pair<std::string, std::string>, but the map returns
elements of std::pair<const std::string, std::string>. In well-designed
languages like C++ that yields an implicit copy perfectly hidden by
constref's lifetime extension. Just use auto, the typedef obscured the
real type anyways.
Found with a little help from clang-tidy's
performance-implicit-cast-in-loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272519
91177308-0d34-0410-b5e6-
96231b3b80d8
}
// Add target-dependent (string) attributes.
- for (const AttrBuilder::td_type &TDA : B.td_attrs())
+ for (const auto &TDA : B.td_attrs())
Attrs.push_back(
std::make_pair(Index, Attribute::get(C, TDA.first, TDA.second)));