aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-02-07 19:36:38 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-02-07 19:36:38 +0000
commit6bd17d2f2e6e498b0ff01e2e755f044de046d138 (patch)
tree70580021eb783d97056803d93eb2becffca73478 /lib/CodeGen
parent52aabafeee9e8634eceb46b1a3fdbd3cd22b1cf7 (diff)
Make use of const-correct ParseCommandLineOptions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150000 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/BackendUtil.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index 1707ec5ea5..e2447340c1 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -246,8 +246,7 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
CM = llvm::CodeModel::Default;
}
- std::vector<const char *> BackendArgs;
- BackendArgs.reserve(16);
+ SmallVector<const char *, 16> BackendArgs;
BackendArgs.push_back("clang"); // Fake program name.
if (!CodeGenOpts.DebugPass.empty()) {
BackendArgs.push_back("-debug-pass");
@@ -265,7 +264,7 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
BackendArgs.push_back("-global-merge=false");
BackendArgs.push_back(0);
llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1,
- const_cast<char **>(&BackendArgs[0]));
+ BackendArgs.data());
std::string FeaturesStr;
if (TargetOpts.Features.size()) {