summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commitbaf53f9ff846905b721e9cf6f626d48752cb9526 (patch)
tree5375e07135f0d5923655a94498d4c4b599ce9447 /clang/lib
parent804137fd759b5ba66f7ef2589a9d1732ec05d9a1 (diff)
downloadbcm5719-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.cpp4
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);
}
}
OpenPOWER on IntegriCloud