clang 8.0.0

Typedefs | Functions
PrintPreprocessedOutput.cpp File Reference
`#include "clang/Frontend/Utils.h"`
`#include "clang/Basic/CharInfo.h"`
`#include "clang/Basic/Diagnostic.h"`
`#include "clang/Basic/SourceManager.h"`
`#include "clang/Frontend/PreprocessorOutputOptions.h"`
`#include "clang/Lex/MacroInfo.h"`
`#include "clang/Lex/PPCallbacks.h"`
`#include "clang/Lex/Pragma.h"`
`#include "clang/Lex/Preprocessor.h"`
`#include "clang/Lex/TokenConcatenation.h"`
`#include "llvm/ADT/STLExtras.h"`
`#include "llvm/ADT/SmallString.h"`
`#include "llvm/ADT/StringRef.h"`
`#include "llvm/Support/ErrorHandling.h"`
`#include "llvm/Support/raw_ostream.h"`
`#include <cstdio>`
Include dependency graph for PrintPreprocessedOutput.cpp:

Go to the source code of this file.

## Typedefs
typedef std::pair< const IdentifierInfo *, MacroInfo * > | id_macro_pair

## Functions
static void | PrintMacroDefinition (const IdentifierInfo &II, const MacroInfo &MI, Preprocessor &PP, raw_ostream &OS)
| PrintMacroDefinition - Print a macro definition in a form that will be properly accepted back as a definition. More...
static void | outputPrintable (raw_ostream &OS, StringRef Str)
static void | PrintPreprocessedTokens (Preprocessor &PP, Token &Tok, PrintPPOutputPPCallbacks *Callbacks, raw_ostream &OS)
static int | MacroIDCompare (const id_macro_pair *LHS, const id_macro_pair *RHS)
static void | DoPrintMacros (Preprocessor &PP, raw_ostream *OS)

## Typedef Documentation

## ◆ id_macro_pair

typedef std::pair<const IdentifierInfo *, MacroInfo *> id_macro_pair

Definition at line 791 of file PrintPreprocessedOutput.cpp.

## Function Documentation

## ◆ DoPrintMacros()

static void DoPrintMacros | ( | Preprocessor & | PP,
|  | raw_ostream * | OS
| ) |  |
| static

Definition at line 796 of file PrintPreprocessedOutput.cpp.

References clang::Preprocessor::EnterMainSourceFile(), clang::comments::tok::eof, clang::MacroDefinition::getMacroInfo(), clang::Preprocessor::IgnorePragmas(), clang::MacroInfo::isBuiltinMacro(), clang::Token::isNot(), clang::Preprocessor::Lex(), clang::Preprocessor::macro_begin(), clang::Preprocessor::macro_end(), MacroIDCompare(), PrintMacroDefinition(), and clang::format::Tok.

Referenced by clang::DoPrintPreprocessedInput().

## ◆ MacroIDCompare()

static int MacroIDCompare | ( | const id_macro_pair * | LHS,
|  | const id_macro_pair * | RHS
| ) |  |
| static

Definition at line 792 of file PrintPreprocessedOutput.cpp.

Referenced by DoPrintMacros().

## ◆ outputPrintable()

static void outputPrintable | ( | raw_ostream & | OS,
|  | StringRef | Str
| ) |  |
| static

Definition at line 432 of file PrintPreprocessedOutput.cpp.

References clang::diag::Error, clang::diag::Fatal, clang::SourceManager::getExpansionColumnNumber(), clang::Token::getLocation(), clang::Preprocessor::getSpelling(), clang::Token::hasLeadingSpace(), clang::diag::Ignored, clang::Token::is(), clang::Token::isNot(), clang::isPrintable(), clang::Preprocessor::Lex(), clang::Preprocessor::LexUnexpandedToken(), clang::diag::Remark, SM, clang::Token::startToken(), clang::format::Tok, and clang::diag::Warning.

## ◆ PrintMacroDefinition()

static void PrintMacroDefinition | ( | const IdentifierInfo & | II,
|  | const MacroInfo & | MI,
|  | Preprocessor & | PP,
|  | raw_ostream & | OS
| ) |  |
| static

PrintMacroDefinition - Print a macro definition in a form that will be properly accepted back as a definition.

Definition at line 35 of file PrintPreprocessedOutput.cpp.

References clang::TokenConcatenation::AvoidConcat(), clang::SrcMgr::C_ExternCSystem, clang::SrcMgr::C_System, clang::SrcMgr::C_User, clang::PPCallbacks::EnterFile, clang::PPCallbacks::ExitFile, clang::PresumedLoc::getFilename(), clang::Module::getFullModuleName(), clang::Token::getIdentifierInfo(), clang::PresumedLoc::getIncludeLoc(), clang::PresumedLoc::getLine(), clang::IdentifierInfo::getName(), clang::IdentifierInfo::getPPKeywordID(), clang::SourceManager::getPresumedLoc(), clang::Preprocessor::getSourceManager(), clang::Preprocessor::getSpelling(), Initialized, clang::MacroInfo::isFunctionLike(), clang::MacroInfo::isGNUVarargs(), clang::PresumedLoc::isInvalid(), clang::SourceLocation::isValid(), NewLine, clang::MacroInfo::param_begin(), clang::MacroInfo::param_empty(), clang::MacroInfo::param_end(), clang::PPCallbacks::RenameFile, SM, llvm::str(), clang::PPCallbacks::SystemHeaderPragma, clang::format::Tok, clang::MacroInfo::tokens(), clang::MacroInfo::tokens_begin(), and clang::MacroInfo::tokens_empty().

Referenced by DoPrintMacros().

## ◆ PrintPreprocessedTokens()

static void PrintPreprocessedTokens | ( | Preprocessor & | PP,
|  | Token & | Tok,
|  | PrintPPOutputPPCallbacks * | Callbacks,
|  | raw_ostream & | OS
| ) |  |
| static

Definition at line 692 of file PrintPreprocessedOutput.cpp.

References clang::Token::getAnnotationValue(), clang::Preprocessor::getCommentRetentionState(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Preprocessor::getLangOpts(), clang::Token::getLength(), clang::Token::getLiteralData(), clang::Token::getLocation(), clang::SourceLocation::getLocWithOffset(), clang::Preprocessor::getSpelling(), clang::Token::hasLeadingSpace(), clang::Token::is(), clang::Token::isAnnotation(), clang::Token::isAtStartOfLine(), clang::Token::isLiteral(), clang::Preprocessor::Lex(), clang::Token::needsCleaning(), and clang::Token::startToken().

Referenced by clang::DoPrintPreprocessedInput().