summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-07-02 21:02:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-07-02 21:02:39 +0000
commitb96067e58d60aaf3351778e62b2fb752045d03a5 (patch)
treef3dea0996c521a6effe470e5aee5fb2fb38bcb4c
parente06d40075e50561bbf5ec1c92828230a81f3ed6f (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241299 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGCall.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index fd20bf15e0..142966e7c0 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/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(), ","));
}
}