aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2015-09-26 01:25:08 +0000
committerEric Christopher <echristo@gmail.com>2015-09-26 01:25:08 +0000
commit583a1f72c7fe102782c28cc7965599cf45ea4770 (patch)
tree5957938a6f9e37bb2ed530d047cc018c18498ccc /clang/lib/CodeGen/BackendUtil.cpp
parentd0bf981296b8d57b95f8d0c9680925612b7373a2 (diff)
downloadllvm-583a1f72c7fe102782c28cc7965599cf45ea4770.zip
llvm-583a1f72c7fe102782c28cc7965599cf45ea4770.tar.gz
llvm-583a1f72c7fe102782c28cc7965599cf45ea4770.tar.bz2
Replace a loop and temporary string copying with llvm::join.
llvm-svn: 248645
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 998a07c..3ba0f80 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -14,6 +14,7 @@
#include "clang/Frontend/CodeGenOptions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/Utils.h"
+#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
@@ -455,13 +456,8 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1,
BackendArgs.data());
- std::string FeaturesStr;
- if (!TargetOpts.Features.empty()) {
- SubtargetFeatures Features;
- for (const std::string &Feature : TargetOpts.Features)
- Features.AddFeature(Feature);
- FeaturesStr = Features.getString();
- }
+ std::string FeaturesStr =
+ llvm::join(TargetOpts.Features.begin(), TargetOpts.Features.end(), ",");
// Keep this synced with the equivalent code in tools/driver/cc1as_main.cpp.
llvm::Reloc::Model RM = llvm::Reloc::Default;