From 454adf645480245725c74fdbe8840ceff039ef64 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. llvm-svn: 239669 --- llvm/include/llvm/Support/CommandLine.h | 13 +++------ llvm/include/llvm/Support/StringSaver.h | 42 ++++++++++++++++++++++++++++++ llvm/lib/LibDriver/LibDriver.cpp | 25 +++--------------- llvm/lib/Support/CMakeLists.txt | 1 + llvm/lib/Support/CommandLine.cpp | 38 +++++++-------------------- llvm/lib/Support/StringSaver.cpp | 19 ++++++++++++++ llvm/unittests/Support/CommandLineTest.cpp | 13 +++------ 7 files changed, 82 insertions(+), 69 deletions(-) create mode 100644 llvm/include/llvm/Support/StringSaver.h create mode 100644 llvm/lib/Support/StringSaver.cpp diff --git a/llvm/include/llvm/Support/CommandLine.h b/llvm/include/llvm/Support/CommandLine.h index 1ad8a3b..ed80921 100644 --- a/llvm/include/llvm/Support/CommandLine.h +++ b/llvm/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