diff options
author | Dan Gohman <gohman@apple.com> | 2010-10-26 23:21:25 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-10-26 23:21:25 +0000 |
commit | 90d9081cacb4b0163f2c7527f666d6515257067c (patch) | |
tree | b51a392f642ba8c4ac72ac2b07e419515e049a0c /include/clang/Frontend/CommandLineSourceLoc.h | |
parent | 92d835a86ac334768d0b75936201e4fea3941c1f (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 'include/clang/Frontend/CommandLineSourceLoc.h')
-rw-r--r-- | include/clang/Frontend/CommandLineSourceLoc.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Frontend/CommandLineSourceLoc.h b/include/clang/Frontend/CommandLineSourceLoc.h index bea468b017..8911cfadd5 100644 --- a/include/clang/Frontend/CommandLineSourceLoc.h +++ b/include/clang/Frontend/CommandLineSourceLoc.h @@ -37,9 +37,15 @@ public: // If both tail splits were valid integers, return success. if (!ColSplit.second.getAsInteger(10, PSL.Column) && - !LineSplit.second.getAsInteger(10, PSL.Line)) + !LineSplit.second.getAsInteger(10, PSL.Line)) { PSL.FileName = LineSplit.first; + // On the command-line, stdin may be specified via "-". Inside the + // compiler, stdin is called "<stdin>". + if (PSL.FileName == "-") + PSL.FileName = "<stdin>"; + } + return PSL; } }; |