summaryrefslogtreecommitdiffstats
path: root/include/clang/Frontend/CommandLineSourceLoc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Frontend/CommandLineSourceLoc.h')
-rw-r--r--include/clang/Frontend/CommandLineSourceLoc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Frontend/CommandLineSourceLoc.h b/include/clang/Frontend/CommandLineSourceLoc.h
index bea468b..8911cfa 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;
}
};
OpenPOWER on IntegriCloud