forked from OSchip/llvm-project
Revert "Update for LLVM change (StringSaver)"
This reverts commit r215785 / 170ebf4f19459ae51a9561d0e65c87ee4c9b2c97. LLD has some StringSavers that need to be updated. One of which takes a lock and I need to investigate that more closely. llvm-svn: 215791
This commit is contained in:
parent
db79484998
commit
bcd500e09a
|
@ -41,7 +41,6 @@
|
|||
#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"
|
||||
|
@ -282,6 +281,18 @@ static void ParseProgName(SmallVectorImpl<const char *> &ArgVector,
|
|||
}
|
||||
}
|
||||
|
||||
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");
|
||||
|
@ -372,7 +383,7 @@ int main(int argc_, const char **argv_) {
|
|||
}
|
||||
|
||||
std::set<std::string> SavedStrings;
|
||||
llvm::StringSaver Saver;
|
||||
StringSetSaver Saver(SavedStrings);
|
||||
llvm::cl::ExpandResponseFiles(Saver, llvm::cl::TokenizeGNUCommandLine, argv);
|
||||
|
||||
// Handle -cc1 integrated tools.
|
||||
|
|
Loading…
Reference in New Issue