diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-14 12:06:21 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-14 12:06:21 +0000 |
commit | 14c598268ff7534d3753ae84eba9b8a81bf0bf8f (patch) | |
tree | 9738b30d50ace204cca6c36e30fcbb87f282ca7f /lib/Sema/SemaExpr.cpp | |
parent | 3164c14cadbb09a05ba811602221e9156077cf44 (diff) |
Use a simpler (and more efficient) pattern to pad vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150475 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index a67bcf413c..4dc8a7bedd 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -4227,8 +4227,7 @@ ExprResult Sema::BuildVectorLiteral(SourceLocation LParenLoc, return ExprError(); } else - for (unsigned i = 0, e = numExprs; i != e; ++i) - initExprs.push_back(exprs[i]); + initExprs.append(exprs, exprs + numExprs); } else { // For OpenCL, when the number of initializers is a single value, @@ -4245,8 +4244,7 @@ ExprResult Sema::BuildVectorLiteral(SourceLocation LParenLoc, return BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc, Literal.take()); } - for (unsigned i = 0, e = numExprs; i != e; ++i) - initExprs.push_back(exprs[i]); + initExprs.append(exprs, exprs + numExprs); } // FIXME: This means that pretty-printing the final AST will produce curly // braces instead of the original commas. |