Searched refs:Tok (Results 26 - 50 of 87) sorted by relevance

1234

/external/clang/lib/Parse/
H A DParseDecl.cpp126 assert(Tok.is(tok::kw___attribute) && "Not a GNU attribute list!");
128 while (Tok.is(tok::kw___attribute)) {
146 if (Tok.isNot(tok::identifier) && !isDeclarationSpecifier())
149 IdentifierInfo *AttrName = Tok.getIdentifierInfo();
152 if (Tok.isNot(tok::l_paren)) {
180 Eof.setLocation(Tok.getLocation());
186 SourceLocation Loc = Tok.getLocation();
230 assert(Tok.is(tok::identifier) && "expected an identifier");
232 Tok.getLocation(),
233 Tok
[all...]
H A DParseDeclCXX.cpp60 assert(Tok.is(tok::kw_namespace) && "Not a namespace!");
64 if (Tok.is(tok::code_completion)) {
78 if (Tok.is(tok::identifier)) {
79 Ident = Tok.getIdentifierInfo();
81 while (Tok.is(tok::coloncolon) && NextToken().is(tok::identifier)) {
83 ExtraIdent.push_back(Tok.getIdentifierInfo());
90 if (Tok.is(tok::kw___attribute)) {
91 attrTok = Tok;
95 if (Tok.is(tok::equal)) {
97 Diag(Tok, dia
[all...]
H A DParseExprCXX.cpp92 TemplateName.setIdentifier(&II, Tok.getLocation());
108 if (!Tok.is(tok::l_paren))
193 if (Tok.is(tok::annot_cxxscope)) {
195 Actions.RestoreNestedNameSpecifierAnnotation(Tok.getAnnotationValue(),
196 Tok.getAnnotationRange(),
202 if (Tok.is(tok::annot_template_id)) {
205 TemplateIdAnnotation *TemplateId = takeTemplateIdAnnotation(Tok);
214 if (Tok.is(tok::coloncolon)) {
235 if (Tok.is(tok::kw_decltype) || Tok
[all...]
H A DParseAST.cpp45 const Token &Tok = P.getCurToken(); local
46 if (Tok.is(tok::eof)) {
51 if (Tok.getLocation().isInvalid()) {
57 Tok.getLocation().print(OS, PP.getSourceManager());
58 if (Tok.isAnnotation()) {
61 // Do the equivalent of PP.getSpelling(Tok) except for the parts that would
65 unsigned Length = Tok.getLength();
66 const char *Spelling = SM.getCharacterData(Tok.getLocation(), &Invalid);
/external/clang/lib/Frontend/
H A DPrintPreprocessedOutput.cpp148 bool HandleFirstTokOnLine(Token &Tok);
162 const Token &Tok) {
163 return ConcatInfo.AvoidConcat(PrevPrevTok, PrevTok, Tok);
505 bool PrintPPOutputPPCallbacks::HandleFirstTokOnLine(Token &Tok) { argument
508 if (!MoveToLine(Tok.getLocation()))
513 unsigned ColNo = SM.getExpansionColumnNumber(Tok.getLocation());
519 if (ColNo == 1 && Tok.hasLeadingSpace())
528 if (ColNo <= 1 && Tok.is(tok::hash))
595 static void PrintPreprocessedTokens(Preprocessor &PP, Token &Tok, argument
608 Callbacks->MoveToLine(Tok
161 AvoidConcat(const Token &PrevPrevTok, const Token &PrevTok, const Token &Tok) argument
682 Token Tok; local
736 Token Tok; local
[all...]
H A DCacheTokens.cpp305 Token Tok; local
308 L.LexFromRawLexer(Tok);
311 if ((Tok.isAtStartOfLine() || Tok.is(tok::eof)) &&
316 // 'Tok' when we exit this branch.
317 Token Tmp = Tok;
325 if (Tok.is(tok::raw_identifier)) {
326 PP.LookUpIdentifierInfo(Tok);
327 EmitToken(Tok);
331 if (Tok
580 Token Tok; local
[all...]
/external/clang/lib/Format/
H A DTokenAnnotator.cpp52 Left->Previous && Left->Previous->Tok.isNot(tok::kw_template);
210 FormatToken *Tok = CurrentToken; local
213 updateParameterCount(Left, Tok);
236 getBinOpPrecedence(Parent->Tok.getKind(), true, true) > prec::Unknown);
287 FormatToken* Tok = CurrentToken; local
290 updateParameterCount(Left, Tok);
375 FormatToken *Tok = CurrentToken; local
377 switch (Tok->Tok.getKind()) {
380 if (!Tok
808 isStartOfName(const FormatToken &Tok) argument
840 rParenEndsCast(const FormatToken &Tok) argument
897 determineStarAmpUsage(const FormatToken &Tok, bool IsExpression, bool InTemplateArgument) argument
956 determinePlusMinusCaretUsage(const FormatToken &Tok) argument
976 determineIncrementUsage(const FormatToken &Tok) argument
1343 splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok, bool InFunctionDecl) argument
1572 spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Tok) argument
1638 isAllmanBrace(const FormatToken &Tok) argument
1818 const FormatToken *Tok = Line.First; local
[all...]
H A DFormatToken.h118 Token Tok; member in struct:clang::format::FormatToken
161 /// This can be different to Tok.getLocation(), which includes leading escaped
269 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); }
292 bool isNot(tok::TokenKind Kind) const { return Tok.isNot(Kind); }
293 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); }
296 return Tok.isObjCAtKeyword(Kind);
314 /// \brief Returns whether \p Tok is ([{ or a template opening <.
319 /// \brief Returns whether \p Tok is )]} or a template closing >.
332 switch (Tok.getKind()) {
357 return getBinOpPrecedence(Tok
362 FormatToken *Tok = Previous; local
370 const FormatToken *Tok = Next; local
[all...]
H A DUnwrappedLineParser.h110 void pushToken(FormatToken *Tok);
204 UnwrappedLineNode() : Tok(nullptr) {}
205 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} argument
207 FormatToken *Tok; member in struct:clang::format::UnwrappedLineNode
H A DTokenAnnotator.h41 : First(Line.Tokens.front().Tok), Level(Line.Level),
57 Current->Next = I->Tok;
58 I->Tok->Previous = Current;
123 /// \brief Calculate the penalty for splitting before \c Tok.
124 unsigned splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok,
130 bool spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Tok);
H A DWhitespaceManager.cpp46 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines, argument
50 if (Tok.Finalized)
52 Tok.Decision = (Newlines > 0) ? FD_Break : FD_Continue;
53 Changes.push_back(Change(true, Tok.WhitespaceRange, IndentLevel, Spaces,
55 Tok.Tok.getKind(), InPPDirective && !Tok.IsFirst));
58 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok, argument
60 if (Tok.Finalized)
62 Changes.push_back(Change(false, Tok
68 replaceWhitespaceInToken( const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars, StringRef PreviousPostfix, StringRef CurrentPrefix, bool InPPDirective, unsigned Newlines, unsigned IndentLevel, int Spaces) argument
[all...]
H A DFormat.cpp719 FormatToken *Tok = I[1]->First; local
720 if (Tok->is(tok::r_brace) && !Tok->MustBreakBefore &&
721 (Tok->getNextNonComment() == nullptr ||
722 Tok->getNextNonComment()->is(tok::semi))) {
724 Tok->SpacesRequiredBefore = 0;
725 Tok->CanBreakBefore = true;
745 if (Tok->is(tok::l_brace) && Tok->BlockKind != BK_BracedInit)
747 Tok
1647 readRawToken(FormatToken &Tok) argument
1863 affectsLeadingEmptyLines(const FormatToken &Tok) argument
1896 FormatToken *Tok = AnnotatedLines[i]->First->Next; local
[all...]
H A DBreakableToken.h75 BreakableToken(const FormatToken &Tok, unsigned IndentLevel, argument
78 : Tok(Tok), IndentLevel(IndentLevel), InPPDirective(InPPDirective),
81 const FormatToken &Tok; member in class:clang::format::BreakableToken
98 BreakableSingleLineToken(const FormatToken &Tok, unsigned IndentLevel,
120 BreakableStringLiteral(const FormatToken &Tok, unsigned IndentLevel,
H A DWhitespaceManager.h47 /// \brief Replaces the whitespace in front of \p Tok. Only call once for
49 void replaceWhitespace(FormatToken &Tok, unsigned Newlines,
58 void addUntouchableToken(const FormatToken &Tok, bool InPPDirective);
63 /// (in this order) at \p Offset inside \p Tok, replacing \p ReplaceChars
74 void replaceWhitespaceInToken(const FormatToken &Tok, unsigned Offset,
H A DBreakableToken.cpp145 const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn,
148 : BreakableToken(Tok, IndentLevel, InPPDirective, Encoding, Style),
150 assert(Tok.TokenText.endswith(Postfix));
151 Line = Tok.TokenText.substr(
152 Prefix.size(), Tok.TokenText.size() - Prefix.size() - Postfix.size());
156 const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn,
159 : BreakableSingleLineToken(Tok, IndentLevel, StartColumn, Prefix, Postfix,
181 Tok, Prefix.size() + TailOffset + Split.first, Split.second, Postfix,
227 Tok, OriginalPrefix.size() + TailOffset + Split.first, Split.second,
235 Tok, OriginalPrefi
144 BreakableSingleLineToken( const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) argument
155 BreakableStringLiteral( const FormatToken &Tok, unsigned IndentLevel, unsigned StartColumn, StringRef Prefix, StringRef Postfix, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) argument
[all...]
/external/clang/include/clang/Lex/
H A DPreprocessor.h76 bool operator==(const Token &Tok) const {
77 return Tok.getKind() == Kind &&
78 (!II || II == Tok.getIdentifierInfo());
340 Token Tok; member in struct:clang::Preprocessor::MacroExpandsInfo
343 MacroExpandsInfo(Token Tok, MacroDirective *MD, SourceRange Range) argument
344 : Tok(Tok), MD(MD), Range(Range) { }
832 bool parseSimpleIntegerLiteral(Token &Tok, uint64_t &Value);
873 void EnterToken(const Token &Tok) { argument
875 CachedTokens.insert(CachedTokens.begin()+CachedLexPos, Tok);
886 AnnotateCachedTokens(const Token &Tok) argument
907 ReplaceLastTokenWithAnnotation(const Token &Tok) argument
915 TypoCorrectToken(const Token &Tok) argument
1011 Diag(const Token &Tok, unsigned DiagID) const argument
1036 getSpelling(const Token &Tok, bool *Invalid = nullptr) const argument
1052 getSpelling(const Token &Tok, const char *&Buffer, bool *Invalid = nullptr) const argument
1075 getSpellingOfSingleCharacterNumericConstant(const Token &Tok, bool *Invalid = nullptr) const argument
[all...]
H A DPTHLexer.h71 bool Lex(Token &Tok);
73 void getEOF(Token &Tok);
/external/clang/lib/Lex/
H A DPPCaching.cpp97 void Preprocessor::AnnotatePreviousCachedTokens(const Token &Tok) { argument
98 assert(Tok.isAnnotation() && "Expected annotation token");
100 assert(CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc()
107 if (AnnotBegin->getLocation() == Tok.getLocation()) {
113 *AnnotBegin = Tok;
H A DPPDirectives.cpp265 Token Tok; local
267 CurLexer->Lex(Tok);
269 if (Tok.is(tok::code_completion)) {
277 if (Tok.is(tok::eof)) {
292 if (Tok.isNot(tok::hash) || !Tok.isAtStartOfLine())
303 LexUnexpandedToken(Tok);
307 if (Tok.isNot(tok::raw_identifier)) {
319 StringRef RI = Tok.getRawIdentifier();
331 // that we can't use Tok
480 Token Tok; local
918 HandleLineDirective(Token &Tok) argument
1137 HandleUserDiagnosticDirective(Token &Tok, bool isWarning) argument
1163 HandleIdentSCCSDirective(Token &Tok) argument
1197 HandleMacroPublicDirective(Token &Tok) argument
1224 HandleMacroPrivateDirective(Token &Tok) argument
1364 Token *Tok = new Token[1]; local
1730 HandleMicrosoftImportDirective(Token &Tok) argument
1790 ReadMacroDefinitionArgList(MacroInfo *MI, Token &Tok) argument
1903 Token Tok; local
[all...]
H A DModuleMap.cpp998 MMToken Tok; member in class:clang::ModuleMapParser
1040 Tok.clear();
1050 SourceLocation Result = Tok.getLocation();
1051 Tok.clear();
1055 Tok.Location = LToken.getLocation().getRawEncoding();
1059 Tok.StringData = RI.data();
1060 Tok.StringLength = RI.size();
1061 Tok.Kind = llvm::StringSwitch<MMToken::TokenKind>(RI)
1081 Tok.Kind = MMToken::Comma;
1085 Tok
[all...]
H A DPreprocessor.cpp190 void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const { argument
191 llvm::errs() << tok::getTokenName(Tok.getKind()) << " '"
192 << getSpelling(Tok) << "'";
197 if (Tok.isAtStartOfLine())
199 if (Tok.hasLeadingSpace())
201 if (Tok.isExpandDisabled())
203 if (Tok.needsCleaning()) {
204 const char *Start = SourceMgr.getCharacterData(Tok.getLocation());
205 llvm::errs() << " [UnClean='" << StringRef(Start, Tok.getLength())
210 DumpLocation(Tok
400 getSpelling(const Token &Tok, SmallVectorImpl<char> &Buffer, bool *Invalid) const argument
422 CreateString(StringRef Str, Token &Tok, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd) argument
776 parseSimpleIntegerLiteral(Token &Tok, uint64_t &Value) argument
[all...]
H A DPTHLexer.cpp46 bool PTHLexer::Lex(Token& Tok) { argument
72 Tok.startToken();
73 Tok.setKind(TKind);
74 Tok.setFlag(TFlags);
76 Tok.setLocation(FileStartLoc.getLocWithOffset(FileOffset));
77 Tok.setLength(Len);
80 if (Tok.isLiteral()) {
81 Tok.setLiteralData((const char*) (PTHMgr.SpellingBase + IdentifierID));
87 Tok.setIdentifierInfo(II);
91 Tok
155 getEOF(Token& Tok) argument
[all...]
/external/clang/include/clang/Parse/
H A DParser.h64 /// Tok - The current token we are peeking ahead. All parsing methods assume
66 Token Tok; member in class:clang::Parser
245 const Token &getCurToken() const { return Tok; }
299 PrevTokLocation = Tok.getLocation();
300 PP.Lex(Tok);
305 if (Tok.isNot(Expected))
309 PrevTokLocation = Tok.getLocation();
310 PP.Lex(Tok);
328 return Tok.getKind() == tok::l_paren || Tok
548 getTypeAnnotation(Token &Tok) argument
553 setTypeAnnotation(Token &Tok, ParsedType T) argument
559 getExprAnnotation(Token &Tok) argument
565 setExprAnnotation(Token &Tok, ExprResult ER) argument
[all...]
/external/clang/lib/Rewrite/Frontend/
H A DInclusionRewriter.cpp80 const DirectoryLookup *Lookup, Token &Tok,
278 FileID FileId, Lexer &RawLex, const DirectoryLookup *Lookup, Token &Tok,
281 RawLex.LexFromRawLexer(Tok);
282 if (Tok.isNot(tok::l_paren))
285 RawLex.LexFromRawLexer(Tok);
292 if (Tok.is(tok::less)) {
293 RawLex.LexFromRawLexer(Tok);
297 if (Tok.is(tok::eod)) // Sanity check.
300 if (Tok.is(tok::raw_identifier))
301 PP.LookUpIdentifierInfo(Tok);
277 HandleHasInclude( FileID FileId, Lexer &RawLex, const DirectoryLookup *Lookup, Token &Tok, bool &FileExists) argument
533 Token Tok; local
[all...]
/external/llvm/lib/IR/
H A DDataLayout.cpp230 StringRef &Tok = Split.first; // Current token. local
233 char Specifier = Tok.front();
234 Tok = Tok.substr(1);
249 unsigned AddrSpace = Tok.empty() ? 0 : getInt(Tok);
255 unsigned PointerMemSize = inBytes(getInt(Tok));
259 unsigned PointerABIAlign = inBytes(getInt(Tok));
265 PointerPrefAlign = inBytes(getInt(Tok));
286 unsigned Size = Tok
[all...]

Completed in 1683 milliseconds

1234