diff options
author | serge-sans-paille <sguelton@redhat.com> | 2021-03-08 17:46:35 +0100 |
---|---|---|
committer | serge-sans-paille <sguelton@redhat.com> | 2021-03-16 13:34:14 +0100 |
commit | b2e78a061c06546c42a977071047cd9da2194a32 (patch) | |
tree | f7f204dd54f8b5b02bc4ecf024e86649cd34b403 /llvm/lib/IR/Attributes.cpp | |
parent | b661788b77e570dc82fe2f89a355713c144407f1 (diff) | |
download | llvm-b2e78a061c06546c42a977071047cd9da2194a32.zip llvm-b2e78a061c06546c42a977071047cd9da2194a32.tar.gz llvm-b2e78a061c06546c42a977071047cd9da2194a32.tar.bz2 |
[NFC] Use SmallString instead of std::string for the AttrBuilder
This avoids a few unnecessary conversion from StringRef to std::string, and a
bunch of extra allocation thanks to the SmallString.
Differential Revision: https://reviews.llvm.org/D98190
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index c98e5c3..18c2f3a 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -1624,7 +1624,7 @@ AttrBuilder &AttrBuilder::addAttribute(Attribute Attr) { } AttrBuilder &AttrBuilder::addAttribute(StringRef A, StringRef V) { - TargetDepAttrs[std::string(A)] = std::string(V); + TargetDepAttrs[A] = V; return *this; } |