Lines Matching defs:FromFile
72 void OutputContentUpTo(const MemoryBuffer &FromFile,
77 const MemoryBuffer &FromFile, StringRef EOL,
197 /// Detect the likely line ending style of \p FromFile by examining the first
199 static StringRef DetectEOL(const MemoryBuffer &FromFile) {
202 const char *Pos = strchr(FromFile.getBufferStart(), '\n');
205 if (Pos + 1 < FromFile.getBufferEnd() && Pos[1] == '\r')
207 if (Pos - 1 >= FromFile.getBufferStart() && Pos[-1] == '\r')
212 /// Writes out bytes from \p FromFile, starting at \p NextToWrite and ending at
214 void InclusionRewriter::OutputContentUpTo(const MemoryBuffer &FromFile,
220 if (&FromFile == PredefinesBuffer) {
225 OS.write(FromFile.getBufferStart() + WriteFrom, WriteTo - WriteFrom);
227 Line += std::count(FromFile.getBufferStart() + WriteFrom,
228 FromFile.getBufferStart() + WriteTo, '\n');
230 char LastChar = FromFile.getBufferStart()[WriteTo - 1];
237 /// Print characters from \p FromFile starting at \p NextToWrite up until the
241 /// through the \p FromFile buffer.
244 const MemoryBuffer &FromFile,
247 OutputContentUpTo(FromFile, NextToWrite,
253 if (&FromFile == PredefinesBuffer) {
258 OutputContentUpTo(FromFile, NextToWrite,
351 const MemoryBuffer &FromFile = *SM.getBuffer(FileId, &Invalid);
354 const char *FileName = FromFile.getBufferIdentifier();
355 Lexer RawLex(FileId, &FromFile, PP.getSourceManager(), PP.getLangOpts());
358 StringRef EOL = DetectEOL(FromFile);
392 CommentOutDirective(RawLex, HashToken, FromFile
421 CommentOutDirective(RawLex, HashToken, FromFile, EOL,
429 CommentOutDirective(RawLex, HashToken, FromFile, EOL,
470 OutputContentUpTo(FromFile, NextToWrite, SM.getFileOffset(Loc),
473 OutputContentUpTo(FromFile, NextToWrite,
481 OutputContentUpTo(FromFile, NextToWrite,
501 FromFile, NextToWrite,
515 OutputContentUpTo(FromFile, NextToWrite,