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)) {
59 std::pair<unsigned, unsigned>
Begin;
62 std::pair<unsigned, unsigned>
End;
74 std::pair<StringRef, StringRef> RangeSplit = Str.rsplit(
'-');
75 unsigned EndLine, EndColumn;
76 bool HasEndLoc =
false;
77 if (!RangeSplit.second.empty()) {
78 std::pair<StringRef, StringRef> Split = RangeSplit.second.rsplit(
':');
79 if (Split.first.getAsInteger(10, EndLine) ||
80 Split.second.getAsInteger(10, EndColumn)) {
84 RangeSplit.first = Str;
89 if (Begin.FileName.empty())
93 EndColumn = Begin.Column;
96 {Begin.Line, Begin.Column},
97 {EndLine, EndColumn}};
108 class parser<
clang::ParsedSourceLocation> final
111 inline bool parse(Option &O, StringRef ArgName, StringRef ArgValue,
116 parser<clang::ParsedSourceLocation>::
117 parse(Option &O, StringRef ArgName, StringRef ArgValue,
119 using namespace clang;
124 <<
"source location must be of the form filename:line:column\n";
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
static Optional< ParsedSourceRange > fromString(StringRef Str)
Returns a parsed source range from a string or None if the string is invalid.
A source range that has been parsed on the command line.
std::pair< unsigned, unsigned > End
The ending location of the range.
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...
std::pair< unsigned, unsigned > Begin
The starting location of the range.
Dataflow Directional Tag Classes.
static ParsedSourceLocation FromString(StringRef Str)
Construct a parsed source location from a string; the Filename is empty on error. ...