#include "clang/Lex/DependencyDirectivesScanner.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Lex/LexDiagnostic.h"
#include "clang/Lex/Lexer.h"
#include "clang/Lex/Pragma.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSwitch.h"
#include <optional>
usingnamespaceclang;
usingnamespaceclang::dependency_directives_scan;
usingnamespacellvm;
namespace {
struct DirectiveWithTokens { … };
struct Scanner { … };
}
bool Scanner::reportError(const char *CurPtr, unsigned Err) { … }
static void skipOverSpaces(const char *&First, const char *const End) { … }
[[nodiscard]] static bool isRawStringLiteral(const char *First,
const char *Current) { … }
static void skipRawString(const char *&First, const char *const End) { … }
static unsigned isEOL(const char *First, const char *const End) { … }
static void skipString(const char *&First, const char *const End) { … }
static unsigned skipNewline(const char *&First, const char *End) { … }
static bool wasLineContinuation(const char *First, unsigned EOLLen) { … }
static void skipToNewlineRaw(const char *&First, const char *const End) { … }
static void skipLineComment(const char *&First, const char *const End) { … }
static void skipBlockComment(const char *&First, const char *const End) { … }
static bool isQuoteCppDigitSeparator(const char *const Start,
const char *const Cur,
const char *const End) { … }
void Scanner::skipLine(const char *&First, const char *const End) { … }
void Scanner::skipDirective(StringRef Name, const char *&First,
const char *const End) { … }
static void skipWhitespace(const char *&First, const char *const End) { … }
bool Scanner::lexModuleDirectiveBody(DirectiveKind Kind, const char *&First,
const char *const End) { … }
dependency_directives_scan::Token &Scanner::lexToken(const char *&First,
const char *const End) { … }
dependency_directives_scan::Token &
Scanner::lexIncludeFilename(const char *&First, const char *const End) { … }
void Scanner::lexPPDirectiveBody(const char *&First, const char *const End) { … }
StringRef
Scanner::cleanStringIfNeeded(const dependency_directives_scan::Token &Tok) { … }
std::optional<StringRef>
Scanner::tryLexIdentifierOrSkipLine(const char *&First, const char *const End) { … }
StringRef Scanner::lexIdentifier(const char *&First, const char *const End) { … }
bool Scanner::isNextIdentifierOrSkipLine(StringRef Id, const char *&First,
const char *const End) { … }
bool Scanner::isNextTokenOrSkipLine(tok::TokenKind K, const char *&First,
const char *const End) { … }
std::optional<StringRef>
Scanner::tryLexStringLiteralOrSkipLine(const char *&First,
const char *const End) { … }
bool Scanner::lexAt(const char *&First, const char *const End) { … }
bool Scanner::lexModule(const char *&First, const char *const End) { … }
bool Scanner::lex_Pragma(const char *&First, const char *const End) { … }
bool Scanner::lexPragma(const char *&First, const char *const End) { … }
bool Scanner::lexEndif(const char *&First, const char *const End) { … }
bool Scanner::lexDefault(DirectiveKind Kind, const char *&First,
const char *const End) { … }
static bool isStartOfRelevantLine(char First) { … }
bool Scanner::lexPPLine(const char *&First, const char *const End) { … }
static void skipUTF8ByteOrderMark(const char *&First, const char *const End) { … }
bool Scanner::scanImpl(const char *First, const char *const End) { … }
bool Scanner::scan(SmallVectorImpl<Directive> &Directives) { … }
bool clang::scanSourceForDependencyDirectives(
StringRef Input, SmallVectorImpl<dependency_directives_scan::Token> &Tokens,
SmallVectorImpl<Directive> &Directives, DiagnosticsEngine *Diags,
SourceLocation InputSourceLoc) { … }
void clang::printDependencyDirectivesAsSource(
StringRef Source,
ArrayRef<dependency_directives_scan::Directive> Directives,
llvm::raw_ostream &OS) { … }