#include "clang/Basic/AttributeCommonInfo.h"
#include "clang/Basic/Attributes.h"
#include "clang/Basic/Builtins.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/CodeCompletionHandler.h"
#include "clang/Lex/DirectoryLookup.h"
#include "clang/Lex/ExternalPreprocessorSource.h"
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/LexDiagnostic.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/MacroArgs.h"
#include "clang/Lex/MacroInfo.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorLexer.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Lex/Token.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <optional>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
usingnamespaceclang;
MacroDirective *
Preprocessor::getLocalMacroDirectiveHistory(const IdentifierInfo *II) const { … }
void Preprocessor::appendMacroDirective(IdentifierInfo *II, MacroDirective *MD){ … }
void Preprocessor::setLoadedMacroDirective(IdentifierInfo *II,
MacroDirective *ED,
MacroDirective *MD) { … }
ModuleMacro *Preprocessor::addModuleMacro(Module *Mod, IdentifierInfo *II,
MacroInfo *Macro,
ArrayRef<ModuleMacro *> Overrides,
bool &New) { … }
ModuleMacro *Preprocessor::getModuleMacro(Module *Mod,
const IdentifierInfo *II) { … }
void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II,
ModuleMacroInfo &Info) { … }
void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) { … }
static IdentifierInfo *RegisterBuiltinMacro(Preprocessor &PP, const char *Name){ … }
void Preprocessor::RegisterBuiltinMacros() { … }
static bool isTrivialSingleTokenExpansion(const MacroInfo *MI,
const IdentifierInfo *MacroIdent,
Preprocessor &PP) { … }
bool Preprocessor::isNextPPTokenLParen() { … }
bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
const MacroDefinition &M) { … }
enum Bracket { … };
static bool CheckMatchedBrackets(const SmallVectorImpl<Token> &Tokens) { … }
static bool GenerateNewArgTokens(Preprocessor &PP,
SmallVectorImpl<Token> &OldTokens,
SmallVectorImpl<Token> &NewTokens,
unsigned &NumArgs,
SmallVectorImpl<SourceRange> &ParenHints,
SmallVectorImpl<SourceRange> &InitLists) { … }
MacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName,
MacroInfo *MI,
SourceLocation &MacroEnd) { … }
Token *Preprocessor::cacheMacroExpandedTokens(TokenLexer *tokLexer,
ArrayRef<Token> tokens) { … }
void Preprocessor::removeCachedMacroExpandedTokensOfLastLexer() { … }
static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
Preprocessor &PP) { … }
static bool HasFeature(const Preprocessor &PP, StringRef Feature) { … }
static bool HasExtension(const Preprocessor &PP, StringRef Extension) { … }
static bool EvaluateHasIncludeCommon(Token &Tok, IdentifierInfo *II,
Preprocessor &PP,
ConstSearchDirIterator LookupFrom,
const FileEntry *LookupFromFile) { … }
EmbedResult Preprocessor::EvaluateHasEmbed(Token &Tok, IdentifierInfo *II) { … }
bool Preprocessor::EvaluateHasInclude(Token &Tok, IdentifierInfo *II) { … }
bool Preprocessor::EvaluateHasIncludeNext(Token &Tok, IdentifierInfo *II) { … }
static void EvaluateFeatureLikeBuiltinMacro(llvm::raw_svector_ostream& OS,
Token &Tok, IdentifierInfo *II,
Preprocessor &PP, bool ExpandArgs,
llvm::function_ref<
int(Token &Tok,
bool &HasLexedNextTok)> Op) { … }
static IdentifierInfo *ExpectFeatureIdentifierInfo(Token &Tok,
Preprocessor &PP,
signed DiagID) { … }
static bool isTargetArch(const TargetInfo &TI, const IdentifierInfo *II) { … }
static bool isTargetVendor(const TargetInfo &TI, const IdentifierInfo *II) { … }
static bool isTargetOS(const TargetInfo &TI, const IdentifierInfo *II) { … }
static bool isTargetEnvironment(const TargetInfo &TI,
const IdentifierInfo *II) { … }
static bool isTargetVariantOS(const TargetInfo &TI, const IdentifierInfo *II) { … }
static bool isTargetVariantEnvironment(const TargetInfo &TI,
const IdentifierInfo *II) { … }
#if defined(__sun__) && defined(__svr4__) && defined(__clang__) && \
__clang__ < 20
asm("_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_"
"RSt8ios_basecPKSt2tmPKcSB_ = "
"_ZNKSt8time_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE3putES3_"
"RSt8ios_basecPK2tmPKcSB_");
#endif
static bool IsBuiltinTrait(Token &Tok) { … }
void Preprocessor::ExpandBuiltinMacro(Token &Tok) { … }
void Preprocessor::markMacroAsUsed(MacroInfo *MI) { … }
void Preprocessor::processPathForFileMacro(SmallVectorImpl<char> &Path,
const LangOptions &LangOpts,
const TargetInfo &TI) { … }
void Preprocessor::processPathToFileName(SmallVectorImpl<char> &FileName,
const PresumedLoc &PLoc,
const LangOptions &LangOpts,
const TargetInfo &TI) { … }