diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:02:39 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-07-02 21:02:39 +0000 |
commit | 9c218592c8400f1ad2345b39e64904fda067553d (patch) | |
tree | 04d2d6759adb4fa1b5005c290ec7359df5e3d542 /clang/lib/CodeGen/CGCall.cpp | |
parent | cd552868939a91308a364951b4bc84d95d53f2bb (diff) | |
download | bcm5719-llvm-9c218592c8400f1ad2345b39e64904fda067553d.tar.gz bcm5719-llvm-9c218592c8400f1ad2345b39e64904fda067553d.zip |
[CodeGen] Use llvm::join to simplify string joining.
While there replace stable_sort of std::string with just sort, stability
is not necessary for "simple" value types. No functional change intended.
llvm-svn: 241299
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index fd20bf15e0d..142966e7c01 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -32,7 +32,6 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/Transforms/Utils/Local.h" -#include <sstream> using namespace clang; using namespace CodeGen; @@ -1544,14 +1543,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, if (TargetCPU != "") FuncAttrs.addAttribute("target-cpu", TargetCPU); if (!Features.empty()) { - std::stable_sort(Features.begin(), Features.end()); - std::stringstream TargetFeatures; - std::copy(Features.begin(), Features.end(), - std::ostream_iterator<std::string>(TargetFeatures, ",")); - - // The drop_back gets rid of the trailing space. + std::sort(Features.begin(), Features.end()); FuncAttrs.addAttribute("target-features", - StringRef(TargetFeatures.str()).drop_back(1)); + llvm::join(Features.begin(), Features.end(), ",")); } } |