aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-26 23:21:25 +0000
committerDan Gohman <gohman@apple.com>2010-10-26 23:21:25 +0000
commit90d9081cacb4b0163f2c7527f666d6515257067c (patch)
treeb51a392f642ba8c4ac72ac2b07e419515e049a0c /lib/Frontend
parent92d835a86ac334768d0b75936201e4fea3941c1f (diff)
Add support for code completion on stdin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/CompilerInstance.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index a187140ca0..95d417f633 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -479,7 +479,10 @@ bool CompilerInstance::InitializeSourceManager(llvm::StringRef InputFile,
Diags.Report(diag::err_fe_error_reading_stdin);
return false;
}
- SourceMgr.createMainFileIDForMemBuffer(SB);
+ const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
+ SB->getBufferSize(), 0);
+ SourceMgr.createMainFileID(File);
+ SourceMgr.overrideFileContents(File, SB);
}
assert(!SourceMgr.getMainFileID().isInvalid() &&