Home | History | Annotate | Download | only in Lex

Lines Matching defs:Directive

1 //===--- PPDirectives.cpp - Directive Handling for Preprocessor -----------===//
10 // This file implements # directive processing for the Preprocessor.
29 // Utility Methods for Preprocessor Directive Handling.
91 assert(Tmp.isNot(tok::eof) && "EOF seen while discarding directive tokens");
98 /// this is due to a a #define, 2 if #undef directive, 0 if it is something
173 // There should be no tokens after the directive, but we allow them as an
180 // or if this is a macro-style preprocessing directive, because it is more
194 /// SkipExcludedConditionalBlock - We just read a #if or related directive and
198 /// this #if directive, so #else/#elif blocks should never be entered. If ElseOk
200 /// so a #else directive is a duplicate. When this returns, the caller can lex
246 // If this token is not a preprocessor directive, just skip it.
251 // directive mode. Tell the lexer this so any newlines we see will be
257 // Read the next token, the directive flavor.
260 // If this isn't an identifier directive (e.g. is "# 1\n" or "#\n", or
289 StringRef Directive;
291 Directive = StringRef(RawCharData, Tok.getLength());
302 Directive = StringRef(DirectiveBuf, IdLen);
305 if (Directive.startswith("if")) {
306 StringRef Sub = Directive.substr(2);
317 } else if (Directive[0] == 'e') {
318 StringRef Sub = Directive.substr(1);
334 // #else directive in a skipping conditional. If not in some other
426 // the directive flavor.
553 // Preprocessor Directive Handling.
557 /// at the start of a line. This consumes the directive, modifies the
563 // We just parsed a # character at the start of a line, so we're in directive
565 // EOD token (which terminates the directive).
572 // pp-directive.
578 // Read the next token, the directive flavor. This isn't expanded due to
582 // C99 6.10.3p11: Is this preprocessor directive in macro invocation? e.g.:
610 return; // null directive.
621 case tok::numeric_constant: // # 7 GNU line marker directive.
623 break; // # 4 is not a preprocessor directive in .S files.
664 // C99 6.10.5 - Error Directive.
668 // C99 6.10.6 - Pragma Directive.
733 // Okay, we're done parsing the directive.
790 /// HandleLineDirective - Handle #line directive: C99 6.10.4. The two
855 /// marker directive.
933 /// HandleDigitDirective - Handle a GNU line marker directive, whose syntax is
1008 /// HandleUserDiagnosticDirective - Handle a #warning or #error directive.
1036 /// HandleIdentSCCSDirective - Handle a #ident/#sccs directive.
1039 // Yes, this directive is an extension.
1046 // If the token kind isn't a string, it's a malformed directive.
1071 /// \brief Handle a #public directive.
1102 /// \brief Handle a #private directive.
1134 // Preprocessor Include Directive Handling.
1244 /// #import. LookupFrom is set when this is a #include_next directive, it
1258 SourceLocation CharEnd; // the end of this directive, in characters
1357 // Notify the callback object that we've seen an inclusion directive.
1407 llvm_unreachable("unknown include directive kind");
1411 // include directive maps to.
1417 // to automatically turn this inclusion directive into a module import.
1428 // If this was an #__include_macros directive, only make macros visible.
1493 // The Microsoft #import directive takes a type library and generates header
1500 // Read tokens until we get to the end of the directive. Note that the
1501 // directive can be split over multiple lines using the backslash character.
1518 /// pseudo directive in the predefines buffer. This handles it by sucking all
1523 // This directive should only occur in the predefines buffer. If not, emit an
1545 // Preprocessor Macro Directive Handling.
1882 // Preprocessor Conditional Directive Handling.
1885 /// HandleIfdefDirective - Implements the #ifdef/#ifndef directive. isIfndef is
1886 /// true when this is a #ifndef directive. ReadAnyTokensBeforeDirective is true
1936 // Should we include the stuff contained by this directive?
1950 /// HandleIfDirective - Implements the #if directive.
1963 // directive seen, handle it for the multiple-include optimization.
1975 // Should we include the stuff contained by this directive?
1987 /// HandleEndifDirective - Implements the #endif directive.
1992 // Check that this is the whole directive.
2013 /// HandleElseDirective - Implements the #else directive.
2018 // #else directive in a non-skipping conditional... start skipping.
2042 /// HandleElifDirective - Implements the #elif directive.
2047 // #elif directive in a non-skipping conditional... start skipping.