Switch all of the "isysroot" const char*'s throughout the AST reader
and writer to StringRef or std::string, as appropriate.
llvm-svn: 135769
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index d37d39c..1b3e81b 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -778,7 +778,7 @@
public:
PrecompilePreambleConsumer(ASTUnit &Unit,
const Preprocessor &PP, bool Chaining,
- const char *isysroot, llvm::raw_ostream *Out)
+ StringRef isysroot, llvm::raw_ostream *Out)
: PCHGenerator(PP, "", Chaining, isysroot, Out), Unit(Unit),
Hash(Unit.getCurrentTopLevelHashValue()) {
Hash = 0;
@@ -838,12 +838,13 @@
OS, Chaining))
return 0;
- const char *isysroot = CI.getFrontendOpts().RelocatablePCH ?
- Sysroot.c_str() : 0;
+ if (!CI.getFrontendOpts().RelocatablePCH)
+ Sysroot.clear();
+
CI.getPreprocessor().addPPCallbacks(
new MacroDefinitionTrackerPPCallbacks(Unit.getCurrentTopLevelHashValue()));
return new PrecompilePreambleConsumer(Unit, CI.getPreprocessor(), Chaining,
- isysroot, OS);
+ Sysroot, OS);
}
virtual bool hasCodeCompletionSupport() const { return false; }
@@ -2347,7 +2348,7 @@
std::vector<unsigned char> Buffer;
llvm::BitstreamWriter Stream(Buffer);
ASTWriter Writer(Stream);
- Writer.WriteAST(getSema(), 0, std::string(), 0);
+ Writer.WriteAST(getSema(), 0, std::string(), "");
// Write the generated bitstream to "Out".
if (!Buffer.empty())