diff options
| author | Chad Rosier <mcrosier@apple.com> | 2012-08-10 21:36:25 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2012-08-10 21:36:25 +0000 |
| commit | baf53f9ff846905b721e9cf6f626d48752cb9526 (patch) | |
| tree | 5375e07135f0d5923655a94498d4c4b599ce9447 /clang/lib | |
| parent | 804137fd759b5ba66f7ef2589a9d1732ec05d9a1 (diff) | |
| download | bcm5719-llvm-baf53f9ff846905b721e9cf6f626d48752cb9526.tar.gz bcm5719-llvm-baf53f9ff846905b721e9cf6f626d48752cb9526.zip | |
[ms-inline asm] Avoid extra allocations by making this an array of StringRefs.
llvm-svn: 161703
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Stmt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/Stmt.cpp b/clang/lib/AST/Stmt.cpp index c9cca556f49..d877c3fab76 100644 --- a/clang/lib/AST/Stmt.cpp +++ b/clang/lib/AST/Stmt.cpp @@ -600,13 +600,13 @@ MSAsmStmt::MSAsmStmt(ASTContext &C, SourceLocation asmloc, for (unsigned i = 0, e = NumLineEnds; i != e; ++i) LineEnds[i] = lineends[i]; - Clobbers = new (C) StringRef*[NumClobbers]; + Clobbers = new (C) StringRef[NumClobbers]; for (unsigned i = 0, e = NumClobbers; i != e; ++i) { // FIXME: Avoid the allocation/copy if at all possible. size_t size = clobbers[i].size(); char *dest = new (C) char[size]; std::strncpy(dest, clobbers[i].data(), size); - Clobbers[i] = new (C) StringRef(dest, size); + Clobbers[i] = StringRef(dest, size); } } |

