diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-07-22 16:35:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-07-22 16:35:34 +0000 |
commit | 832d620b4ae0fc5fe28561b885b4cfc65cf5c9ab (patch) | |
tree | 499c921a0e163c0aaf47afc091a045a13556f64c /lib/Serialization/GeneratePCH.cpp | |
parent | 72a9ae18553bf8b6bdad84d2c54f73741a47e275 (diff) |
Switch all of the "isysroot" const char*'s throughout the AST reader
and writer to StringRef or std::string, as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/GeneratePCH.cpp')
-rw-r--r-- | lib/Serialization/GeneratePCH.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp index 9cd694e05c..16352c8e13 100644 --- a/lib/Serialization/GeneratePCH.cpp +++ b/lib/Serialization/GeneratePCH.cpp @@ -23,18 +23,16 @@ #include "llvm/Bitcode/BitstreamWriter.h" #include "llvm/Support/raw_ostream.h" #include <string> -#include <string.h> -#include <stdlib.h> using namespace clang; PCHGenerator::PCHGenerator(const Preprocessor &PP, const std::string &OutputFile, bool Chaining, - const char *isysroot, + StringRef isysroot, llvm::raw_ostream *OS) - : PP(PP), OutputFile(OutputFile), isysroot(0), Out(OS), SemaPtr(0), - StatCalls(0), Stream(Buffer), Writer(Stream), Chaining(Chaining) { + : PP(PP), OutputFile(OutputFile), isysroot(isysroot.str()), Out(OS), + SemaPtr(0), StatCalls(0), Stream(Buffer), Writer(Stream), Chaining(Chaining) { // Install a stat() listener to keep track of all of the stat() // calls. StatCalls = new MemorizeStatCalls(); @@ -42,13 +40,9 @@ PCHGenerator::PCHGenerator(const Preprocessor &PP, // *after* the already installed ASTReader's stat cache. PP.getFileManager().addStatCache(StatCalls, /*AtBeginning=*/!Chaining); - - if (isysroot) - this->isysroot = strdup(isysroot); } PCHGenerator::~PCHGenerator() { - free((void*)isysroot); } void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) { |