aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
-rw-r--r--clang/unittests/Frontend/CompilerInvocationTest.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp
index 4ff6824..94ab9fe 100644
--- a/clang/unittests/Frontend/CompilerInvocationTest.cpp
+++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp
@@ -31,17 +31,19 @@ class CommandLineTest : public ::testing::Test {
public:
IntrusiveRefCntPtr<DiagnosticsEngine> Diags;
SmallVector<const char *, 32> GeneratedArgs;
- SmallVector<std::string, 32> GeneratedArgsStorage;
+ BumpPtrAllocator Alloc;
+ StringSaver StringPool;
CompilerInvocation Invocation;
const char *operator()(const Twine &Arg) {
- return GeneratedArgsStorage.emplace_back(Arg.str()).c_str();
+ return StringPool.save(Arg).data();
}
CommandLineTest()
: Diags(CompilerInstance::createDiagnostics(
*llvm::vfs::getRealFileSystem(), new DiagnosticOptions(),
- new TextDiagnosticBuffer())) {}
+ new TextDiagnosticBuffer())),
+ StringPool(Alloc) {}
};
template <typename M>