aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2021-03-08 17:46:35 +0100
committerserge-sans-paille <sguelton@redhat.com>2021-03-16 13:34:14 +0100
commitb2e78a061c06546c42a977071047cd9da2194a32 (patch)
treef7f204dd54f8b5b02bc4ecf024e86649cd34b403 /llvm/lib/IR/Attributes.cpp
parentb661788b77e570dc82fe2f89a355713c144407f1 (diff)
downloadllvm-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.cpp2
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;
}