reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Format/AffectedRangeManager.cpp
   79   End = End.getLocWithOffset(Last.TokenText.size());
tools/clang/lib/Format/BreakableToken.cpp
  189   StringRef Content = Token.TokenText.substr(2).ltrim();
  241   assert(Tok.TokenText.startswith(Prefix) && Tok.TokenText.endswith(Postfix));
  241   assert(Tok.TokenText.startswith(Prefix) && Tok.TokenText.endswith(Postfix));
  242   Line = Tok.TokenText.substr(
  243       Prefix.size(), Tok.TokenText.size() - Prefix.size() - Postfix.size());
  292       Text.data() - tokenAt(LineIndex).TokenText.data() + Split.first;
  343   StringRef TokenText(Tok.TokenText);
  587       Text.data() - tokenAt(LineIndex).TokenText.data() + Split.first;
  635                                      tokenAt(LineIndex).TokenText.data();
  637                               tokenAt(LineIndex).TokenText.data() -
  686                                      tokenAt(LineIndex).TokenText.data();
  688                               tokenAt(LineIndex).TokenText.data() -
  734     StringRef TokenText(CurrentTok->TokenText);
  833       Text.data() - tokenAt(LineIndex).TokenText.data() + Split.first;
  882                       tokenAt(LineIndex - 1).TokenText.data();
  886         Lines[LineIndex].data() - tokenAt(LineIndex).TokenText.data() - Offset;
  897       Lines[LineIndex].data() - tokenAt(LineIndex).TokenText.data();
tools/clang/lib/Format/ContinuationIndenter.cpp
  492       ((Previous.is(tok::identifier) && Previous.TokenText == "endl") ||
  493        (Previous.Tok.isLiteral() && (Previous.TokenText.endswith("\\n\"") ||
  494                                      Previous.TokenText == "\'\\n\'"))))
 1505   StringRef OldDelimiter = *getRawStringDelimiter(Current.TokenText);
 1517       Current.TokenText.substr(OldPrefixSize).drop_back(OldSuffixSize);
 1541   bool ContentStartsOnNewline = Current.TokenText[OldPrefixSize] == '\n';
 1608           Current.Tok.getLocation().getLocWithOffset(Current.TokenText.size() -
 1737   return Tok->TokenText;
 1745   auto Delimiter = getRawStringDelimiter(Current.TokenText);
 1788     StringRef Text = Current.TokenText;
 1827         CommentPragmasRegex.match(Current.TokenText.substr(2)) ||
 2223   if (Current.TokenText.startswith("R\""))
tools/clang/lib/Format/Format.cpp
 1270         StringRef Input = FormatTok->TokenText;
 1781                                 FormatTok->TokenText)) ||
 1792                      << " token: " << FormatTok->TokenText << " token type: "
tools/clang/lib/Format/FormatToken.h
  386     if (is(TT_TemplateString) && TokenText.endswith("${"))
  396     if (is(TT_TemplateString) && TokenText.startswith("}"))
  462     StringRef Content = TokenText;
tools/clang/lib/Format/FormatTokenLexer.cpp
  139   At->TokenText = StringRef(At->TokenText.begin(),
  139   At->TokenText = StringRef(At->TokenText.begin(),
  140                             String->TokenText.end() - At->TokenText.begin());
  140                             String->TokenText.end() - At->TokenText.begin());
  157   Hash->TokenText =
  158       StringRef(Hash->TokenText.begin(),
  159                 Identifier->TokenText.end() - Hash->TokenText.begin());
  159                 Identifier->TokenText.end() - Hash->TokenText.begin());
  176   if (!(At->is(tok::at) || At->TokenText == "$") ||
  182     if (Dollar->TokenText == "$") {
  185       Dollar->TokenText =
  186           StringRef(Dollar->TokenText.begin(),
  187                     String->TokenText.end() - Dollar->TokenText.begin());
  187                     String->TokenText.end() - Dollar->TokenText.begin());
  198   At->TokenText = StringRef(At->TokenText.begin(),
  198   At->TokenText = StringRef(At->TokenText.begin(),
  199                             String->TokenText.end() - At->TokenText.begin());
  199                             String->TokenText.end() - At->TokenText.begin());
  214   FirstQuestion->TokenText = StringRef(FirstQuestion->TokenText.begin(),
  214   FirstQuestion->TokenText = StringRef(FirstQuestion->TokenText.begin(),
  215                                        SecondQuestion->TokenText.end() -
  216                                            FirstQuestion->TokenText.begin());
  234   At->TokenText = StringRef(At->TokenText.begin(),
  234   At->TokenText = StringRef(At->TokenText.begin(),
  235                             Keyword->TokenText.end() - At->TokenText.begin());
  235                             Keyword->TokenText.end() - At->TokenText.begin());
  251   Identifier->TokenText =
  252       StringRef(Identifier->TokenText.begin(),
  253                 Question->TokenText.end() - Identifier->TokenText.begin());
  253                 Question->TokenText.end() - Identifier->TokenText.begin());
  266   if (Identifier->TokenText != "foreach")
  294   First[0]->TokenText = "<<";
  314     AddLength += First[i]->TokenText.size();
  317   First[0]->TokenText = StringRef(First[0]->TokenText.data(),
  317   First[0]->TokenText = StringRef(First[0]->TokenText.data(),
  318                                   First[0]->TokenText.size() + AddLength);
  383   const char *RegexBegin = Offset - RegexToken->TokenText.size();
  412   RegexToken->TokenText = StringRef(RegexBegin, Offset - RegexBegin);
  413   RegexToken->ColumnWidth = RegexToken->TokenText.size();
  433              BacktickToken->TokenText == "`") {
  441   const char *TmplBegin = Offset - BacktickToken->TokenText.size(); // at "`"
  461   BacktickToken->TokenText = LiteralText;
  491       Lex->getBufferLocation() - HashToken->TokenText.size(); // at "#"
  499   HashToken->TokenText = Lex->getBuffer().substr(From, Len);
  521   if (Macro->TokenText != "_T")
  524   const char *Start = Macro->TokenText.data();
  525   const char *End = Last->TokenText.data() + Last->TokenText.size();
  525   const char *End = Last->TokenText.data() + Last->TokenText.size();
  526   String->TokenText = StringRef(Start, End - Start);
  532       String->TokenText, String->OriginalColumn, Style.TabWidth, Encoding);
  608   StringRef TokenText = FormatTok->TokenText;
  617   FormatTok->TokenText = TokenText;
  640     StringRef Text = FormatTok->TokenText;
  708       FormatTok->is(tok::comment) && FormatTok->TokenText.startswith("//")) {
  709     size_t BackslashPos = FormatTok->TokenText.find('\\');
  711       if (BackslashPos + 1 < FormatTok->TokenText.size() &&
  712           FormatTok->TokenText[BackslashPos + 1] == '\n') {
  714         Offset -= FormatTok->TokenText.size();
  717         FormatTok->TokenText = FormatTok->TokenText.substr(0, BackslashPos + 1);
  717         FormatTok->TokenText = FormatTok->TokenText.substr(0, BackslashPos + 1);
  719             FormatTok->TokenText, FormatTok->OriginalColumn, Style.TabWidth,
  723       BackslashPos = FormatTok->TokenText.find('\\', BackslashPos + 1);
  731   while (FormatTok->TokenText.size() > 1 && FormatTok->TokenText[0] == '\\') {
  731   while (FormatTok->TokenText.size() > 1 && FormatTok->TokenText[0] == '\\') {
  733     if (FormatTok->TokenText.size() > 2 &&
  734         (FormatTok->TokenText[1] == '\r' && FormatTok->TokenText[2] == '\n'))
  734         (FormatTok->TokenText[1] == '\r' && FormatTok->TokenText[2] == '\n'))
  736     else if (FormatTok->TokenText[1] == '\n')
  745     FormatTok->TokenText = FormatTok->TokenText.substr(SkippedWhitespace);
  745     FormatTok->TokenText = FormatTok->TokenText.substr(SkippedWhitespace);
  756     StringRef UntrimmedText = FormatTok->TokenText;
  757     FormatTok->TokenText = FormatTok->TokenText.rtrim(" \t\v\f");
  757     FormatTok->TokenText = FormatTok->TokenText.rtrim(" \t\v\f");
  758     TrailingWhitespace = UntrimmedText.size() - FormatTok->TokenText.size();
  760     IdentifierInfo &Info = IdentTable.get(FormatTok->TokenText);
  776     FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
  776     FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
  781     FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
  781     FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
  788   StringRef Text = FormatTok->TokenText;
  831   Tok.TokenText = StringRef(SourceMgr.getCharacterData(Tok.Tok.getLocation()),
  836     if (!Tok.TokenText.empty() && Tok.TokenText[0] == '"') {
  836     if (!Tok.TokenText.empty() && Tok.TokenText[0] == '"') {
  840                Tok.TokenText == "''") {
  852   if (Tok.is(tok::comment) && (Tok.TokenText == "// clang-format on" ||
  853                                Tok.TokenText == "/* clang-format on */")) {
  859   if (Tok.is(tok::comment) && (Tok.TokenText == "// clang-format off" ||
  860                                Tok.TokenText == "/* clang-format off */")) {
tools/clang/lib/Format/NamespaceEndCommentsFixer.cpp
   43       name += Tok->TokenText;
   59       name += Tok->TokenText;
   71   text += NamespaceTok->TokenText;
  106       NamespaceMacroCommentPattern->match(Comment->TokenText, &Groups)) {
  109     if (NamespaceTokenText != NamespaceTok->TokenText)
  112              !NamespaceCommentPattern->match(Comment->TokenText, &Groups)) {
  177   return NamespaceTok ? NamespaceTok->TokenText : StringRef();
  215         NamespaceTokenText = NamespaceTok->TokenText;
tools/clang/lib/Format/SortJavaScriptImports.cpp
  342           Current->TokenText.substr(1, Current->TokenText.size() - 2);
  342           Current->TokenText.substr(1, Current->TokenText.size() - 2);
  356           Current->TokenText.substr(1, Current->TokenText.size() - 2);
  356           Current->TokenText.substr(1, Current->TokenText.size() - 2);
  389     Reference.Prefix = Current->TokenText;
  416       Symbol.Symbol = Current->TokenText;
  426         Symbol.Alias = Current->TokenText;
tools/clang/lib/Format/TokenAnnotator.cpp
 1017             !CurrentToken->TokenText.startswith("//"))
 1210     return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
 1212            (Tok.Next->Next->TokenText == "module" ||
 1213             Tok.Next->Next->TokenText == "provide" ||
 1214             Tok.Next->Next->TokenText == "require" ||
 1215             Tok.Next->Next->TokenText == "requireType" ||
 1216             Tok.Next->Next->TokenText == "forwardDeclare") &&
 1428       if (Current.TokenText.startswith("/*")) {
 1429         if (Current.TokenText.endswith("*/"))
 1452                   BeforeParen->TokenText == BeforeParen->TokenText.upper() &&
 1452                   BeforeParen->TokenText == BeforeParen->TokenText.upper() &&
 2334     if ((Left.is(TT_TemplateString) && Left.TokenText.endswith("${")) ||
 2335         (Right.is(TT_TemplateString) && Right.TokenText.startswith("}")))
 2424     bool is_short_annotation = Right.TokenText.size() < 10;
 2648            !Left.TokenText.endswith("=*/");
 2682   if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L")
 2771     if ((Left.is(TT_TemplateString) && Left.TokenText.endswith("${")) ||
 2772         (Right.is(TT_TemplateString) && Right.TokenText.startswith("}")))
 2913       if (Left.is(tok::exclaim) && Left.TokenText == "not")
 2915       if (Left.is(tok::tilde) && Left.TokenText == "compl")
 3094   if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\""))
 3553     llvm::errs() << " Text='" << Tok->TokenText << "'\n";
tools/clang/lib/Format/UnwrappedLineFormatter.cpp
  151   return NamespaceToken ? NamespaceToken->TokenText : StringRef();
  159   return NamespaceToken ? NamespaceToken->TokenText : StringRef();
  265                nsToken->TokenText == getNamespaceTokenText(I[i + 1]) &&
  281                nsToken->TokenText ==
  718     llvm::dbgs() << (P.Tok ? P.Tok->TokenText : "F") << "|" << P.Indent << "|"
  721   llvm::dbgs() << State.NextToken->TokenText << "\n";
tools/clang/lib/Format/UnwrappedLineParser.cpp
   60   return FormatTok.is(tok::comment) && !FormatTok.TokenText.startswith("/*");
  600   if (I->Tok->TokenText != "goog")
  606   if (I->Tok->TokenText != "scope")
  752   if (!IfDef && (FormatTok->is(tok::kw_false) || FormatTok->TokenText == "0"))
  754   if (IfDef && !IfNDef && FormatTok->TokenText == "SWIG")
  815       IncludeGuardToken->TokenText == FormatTok->TokenText) {
  815       IncludeGuardToken->TokenText == FormatTok->TokenText) {
  947       Previous->is(TT_TemplateString) && Previous->TokenText.endswith("${");
  962       Next->is(TT_TemplateString) && Next->TokenText.startswith("}");
 1343       StringRef Text = FormatTok->TokenText;
 2203         FormatTok->TokenText != FormatTok->TokenText.upper();
 2203         FormatTok->TokenText != FormatTok->TokenText.upper();
 2507   StringRef IndentContent = FormatTok.TokenText;
 2508   if (FormatTok.TokenText.startswith("//") ||
 2509       FormatTok.TokenText.startswith("/*"))
 2510     IndentContent = FormatTok.TokenText.substr(2);
tools/clang/lib/Format/UsingDeclarationsSorter.cpp
  102     Label.append(Tok->TokenText.str());