15 #ifndef LLVM_CLANG_FRONTEND_COMMANDLINESOURCELOC_H
16 #define LLVM_CLANG_FRONTEND_COMMANDLINESOURCELOC_H
19 #include "llvm/Support/CommandLine.h"
20 #include "llvm/Support/raw_ostream.h"
35 std::pair<StringRef, StringRef> ColSplit = Str.rsplit(
':');
36 std::pair<StringRef, StringRef> LineSplit =
37 ColSplit.first.rsplit(
':');
40 if (!ColSplit.second.getAsInteger(10, PSL.
Column) &&
41 !LineSplit.second.getAsInteger(10, PSL.
Line)) {
62 class parser<clang::ParsedSourceLocation> final
65 inline bool parse(Option &O, StringRef ArgName, StringRef ArgValue,
71 parse(Option &O, StringRef ArgName, StringRef ArgValue,
73 using namespace clang;
75 Val = ParsedSourceLocation::FromString(ArgValue);
78 <<
"source location must be of the form filename:line:column\n";
A source location that has been parsed on the command line.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
bool parse(Option &O, StringRef ArgName, StringRef ArgValue, clang::ParsedSourceLocation &Val)
static ParsedSourceLocation FromString(StringRef Str)
Construct a parsed source location from a string; the Filename is empty on error. ...