aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-10 21:36:25 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-10 21:36:25 +0000
commit33c72e1c0bbb477cf36dd7becd933b860c42ed8c (patch)
tree7e4ab9ddd9e61c473bf923b89ce65600eac9d3e7 /lib/AST/Stmt.cpp
parent60e25804d14a52c173548f0f6c66d3d831cb901c (diff)
[ms-inline asm] Avoid extra allocations by making this an array of StringRefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Stmt.cpp')
-rw-r--r--lib/AST/Stmt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp
index c9cca556f4..d877c3fab7 100644
--- a/lib/AST/Stmt.cpp
+++ b/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);
}
}