[cfe-commits] r82525 - /cfe/trunk/lib/Frontend/PCHReader.cpp
Daniel Dunbar
daniel at zuster.org
Mon Sep 21 22:38:02 PDT 2009
Author: ddunbar
Date: Tue Sep 22 00:38:01 2009
New Revision: 82525
URL: http://llvm.org/viewvc/llvm-project?rev=82525&view=rev
Log:
Allow PCH files to be read from stdin.
Modified:
cfe/trunk/lib/Frontend/PCHReader.cpp
Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=82525&r1=82524&r2=82525&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Tue Sep 22 00:38:01 2009
@@ -1388,8 +1388,13 @@
this->FileName = FileName;
// Open the PCH file.
+ //
+ // FIXME: This shouldn't be here, we should just take a raw_ostream.
std::string ErrStr;
- Buffer.reset(llvm::MemoryBuffer::getFile(FileName.c_str(), &ErrStr));
+ if (FileName == "-")
+ Buffer.reset(llvm::MemoryBuffer::getSTDIN());
+ else
+ Buffer.reset(llvm::MemoryBuffer::getFile(FileName.c_str(), &ErrStr));
if (!Buffer) {
Error(ErrStr.c_str());
return IgnorePCH;
More information about the cfe-commits
mailing list