[ASTWriter] Replace `const std::string &OutputFile` with `StringRef OutputFile` in some of `ASTWriter` functions, NFC

This is to make it consistent with LLVM's string parameter passing convention.
This commit is contained in:
Argyrios Kyrtzidis 2022-07-27 23:00:56 -07:00
parent 726d9f8e8c
commit a9ae2f2764
2 changed files with 6 additions and 9 deletions

View File

@ -455,7 +455,7 @@ private:
void WriteBlockInfoBlock();
void WriteControlBlock(Preprocessor &PP, ASTContext &Context,
StringRef isysroot, const std::string &OutputFile);
StringRef isysroot, StringRef OutputFile);
/// Write out the signature and diagnostic options, and return the signature.
ASTFileSignature writeUnhashedControlBlock(Preprocessor &PP,
@ -533,8 +533,7 @@ private:
void WriteDecl(ASTContext &Context, Decl *D);
ASTFileSignature WriteASTCore(Sema &SemaRef, StringRef isysroot,
const std::string &OutputFile,
Module *WritingModule);
StringRef OutputFile, Module *WritingModule);
public:
/// Create a new precompiled header writer that outputs to
@ -571,7 +570,7 @@ public:
///
/// \return the module signature, which eventually will be a hash of
/// the module but currently is merely a random 32-bit number.
ASTFileSignature WriteAST(Sema &SemaRef, const std::string &OutputFile,
ASTFileSignature WriteAST(Sema &SemaRef, StringRef OutputFile,
Module *WritingModule, StringRef isysroot,
bool hasErrors = false,
bool ShouldCacheASTInMemory = false);

View File

@ -1187,8 +1187,7 @@ ASTFileSignature ASTWriter::writeUnhashedControlBlock(Preprocessor &PP,
/// Write the control block.
void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
StringRef isysroot,
const std::string &OutputFile) {
StringRef isysroot, StringRef OutputFile) {
using namespace llvm;
Stream.EnterSubblock(CONTROL_BLOCK_ID, 5);
@ -4481,8 +4480,7 @@ time_t ASTWriter::getTimestampForOutput(const FileEntry *E) const {
return IncludeTimestamps ? E->getModificationTime() : 0;
}
ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef,
const std::string &OutputFile,
ASTFileSignature ASTWriter::WriteAST(Sema &SemaRef, StringRef OutputFile,
Module *WritingModule, StringRef isysroot,
bool hasErrors,
bool ShouldCacheASTInMemory) {
@ -4528,7 +4526,7 @@ static void AddLazyVectorDecls(ASTWriter &Writer, Vector &Vec,
}
ASTFileSignature ASTWriter::WriteASTCore(Sema &SemaRef, StringRef isysroot,
const std::string &OutputFile,
StringRef OutputFile,
Module *WritingModule) {
using namespace llvm;