clang API Documentation
#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>
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) |
| static void | outputPrintable (llvm::raw_ostream &OS, const std::string &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 std::pair<const IdentifierInfo *, MacroInfo *> id_macro_pair |
Definition at line 672 of file PrintPreprocessedOutput.cpp.
| static void DoPrintMacros | ( | Preprocessor & | PP, |
| raw_ostream * | OS | ||
| ) | [static] |
Definition at line 677 of file PrintPreprocessedOutput.cpp.
References clang::Preprocessor::EnterMainSourceFile(), clang::comments::tok::eof, clang::Preprocessor::IgnorePragmas(), clang::MacroInfo::isBuiltinMacro(), clang::Token::isNot(), clang::Preprocessor::Lex(), clang::Preprocessor::macro_begin(), clang::Preprocessor::macro_end(), MacroIDCompare(), and PrintMacroDefinition().
Referenced by clang::DoPrintPreprocessedInput().
| static int MacroIDCompare | ( | const id_macro_pair * | LHS, |
| const id_macro_pair * | RHS | ||
| ) | [static] |
Definition at line 673 of file PrintPreprocessedOutput.cpp.
Referenced by DoPrintMacros().
| static void outputPrintable | ( | llvm::raw_ostream & | OS, |
| const std::string & | Str | ||
| ) | [static] |
Definition at line 376 of file PrintPreprocessedOutput.cpp.
References clang::isPrintable().
| 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::MacroInfo::arg_begin(), clang::MacroInfo::arg_empty(), clang::MacroInfo::arg_end(), clang::IdentifierInfo::getName(), clang::Preprocessor::getSpelling(), clang::MacroInfo::isFunctionLike(), clang::MacroInfo::isGNUVarargs(), clang::MacroInfo::tokens_begin(), clang::MacroInfo::tokens_empty(), and clang::MacroInfo::tokens_end().
Referenced by DoPrintMacros().
| static void PrintPreprocessedTokens | ( | Preprocessor & | PP, |
| Token & | Tok, | ||
| PrintPPOutputPPCallbacks * | Callbacks, | ||
| raw_ostream & | OS | ||
| ) | [static] |
Definition at line 598 of file PrintPreprocessedOutput.cpp.
References clang::comments::tok::eof, 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::isAtStartOfLine(), clang::Token::isLiteral(), clang::Preprocessor::Lex(), clang::Token::needsCleaning(), and clang::Token::startToken().
Referenced by clang::DoPrintPreprocessedInput().