r239670 - Update for llvm api change.

Rafael Espindola rafael.espindola at gmail.com
Sat Jun 13 05:50:09 PDT 2015


Author: rafael
Date: Sat Jun 13 07:50:07 2015
New Revision: 239670

URL: http://llvm.org/viewvc/llvm-project?rev=239670&view=rev
Log:
Update for llvm api change.

Modified:
    cfe/trunk/tools/driver/driver.cpp

Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=239670&r1=239669&r2=239670&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Sat Jun 13 07:50:07 2015
@@ -43,6 +43,7 @@
 #include "llvm/Support/Program.h"
 #include "llvm/Support/Regex.h"
 #include "llvm/Support/Signals.h"
+#include "llvm/Support/StringSaver.h"
 #include "llvm/Support/TargetRegistry.h"
 #include "llvm/Support/TargetSelect.h"
 #include "llvm/Support/Timer.h"
@@ -290,18 +291,6 @@ static void ParseProgName(SmallVectorImp
   }
 }
 
-namespace {
-  class StringSetSaver : public llvm::cl::StringSaver {
-  public:
-    StringSetSaver(std::set<std::string> &Storage) : Storage(Storage) {}
-    const char *SaveString(const char *Str) override {
-      return GetStableCStr(Storage, Str);
-    }
-  private:
-    std::set<std::string> &Storage;
-  };
-}
-
 static void SetBackdoorDriverOutputsFromEnvVars(Driver &TheDriver) {
   // Handle CC_PRINT_OPTIONS and CC_PRINT_OPTIONS_FILE.
   TheDriver.CCPrintOptions = !!::getenv("CC_PRINT_OPTIONS");
@@ -391,8 +380,8 @@ int main(int argc_, const char **argv_)
     return 1;
   }
 
-  std::set<std::string> SavedStrings;
-  StringSetSaver Saver(SavedStrings);
+  llvm::BumpPtrAllocator A;
+  llvm::BumpPtrStringSaver Saver(A);
 
   // Determines whether we want nullptr markers in argv to indicate response
   // files end-of-lines. We only use this for the /LINK driver argument.
@@ -426,6 +415,7 @@ int main(int argc_, const char **argv_)
     }
   }
 
+  std::set<std::string> SavedStrings;
   // Handle CCC_OVERRIDE_OPTIONS, used for editing a command line behind the
   // scenes.
   if (const char *OverrideStr = ::getenv("CCC_OVERRIDE_OPTIONS")) {





More information about the cfe-commits mailing list