From 8e2ed1643a03a892f0d97bcc0098c3c53eee1e6b Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 13 Jun 2015 12:49:52 +0000 Subject: [PATCH] Bring in a BumpPtrStringSaver from lld and simplify the interface. StringSaver now always saves to a BumpPtrAllocator. The only reason for having the virtual saveImpl is so lld can have a thread safe version. The reason for the distinct BumpPtrStringSaver class is to avoid the virtual destructor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239669 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/CommandLine.h | 13 ++------- include/llvm/Support/StringSaver.h | 42 +++++++++++++++++++++++++++ lib/LibDriver/LibDriver.cpp | 25 ++-------------- lib/Support/CMakeLists.txt | 1 + lib/Support/CommandLine.cpp | 38 +++++++----------------- lib/Support/StringSaver.cpp | 19 ++++++++++++ unittests/Support/CommandLineTest.cpp | 13 +++------ 7 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 include/llvm/Support/StringSaver.h create mode 100644 lib/Support/StringSaver.cpp diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 1ad8a3bfd93..ed809211ea9 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -33,6 +33,9 @@ namespace llvm { +class BumpPtrStringSaver; +class StringSaver; + /// cl Namespace - This namespace contains all of the command line option /// processing machinery. It is intentionally a short name to make qualified /// usage concise. @@ -1676,16 +1679,6 @@ StringMap