13#ifndef LLVM_CLANG_AST_PRETTYPRINTER_H
14#define LLVM_CLANG_AST_PRETTYPRINTER_H
18#include "llvm/ADT/STLForwardCompat.h"
39 virtual std::string
remapPath(StringRef Path)
const {
40 return std::string(Path);
91 MSVCFormatting(
false), ConstantsAsWritten(
false),
92 SuppressImplicitBase(
false), FullyQualifiedName(
false),
93 PrintAsCanonical(
false), PrintInjectedClassNameWithArguments(
true),
94 UsePreferredNames(
true), AlwaysIncludeTypeForTemplateArgument(
false),
127 LLVM_PREFERRED_TYPE(
bool)
138 LLVM_PREFERRED_TYPE(
bool)
147 LLVM_PREFERRED_TYPE(
bool)
158 LLVM_PREFERRED_TYPE(
bool)
162 LLVM_PREFERRED_TYPE(
bool)
167 LLVM_PREFERRED_TYPE(
bool)
189 LLVM_PREFERRED_TYPE(
bool)
208 LLVM_PREFERRED_TYPE(
bool)
215 LLVM_PREFERRED_TYPE(
bool)
219 LLVM_PREFERRED_TYPE(
bool)
224 LLVM_PREFERRED_TYPE(
bool)
229 LLVM_PREFERRED_TYPE(
bool)
234 LLVM_PREFERRED_TYPE(
bool)
239 LLVM_PREFERRED_TYPE(
bool)
243 LLVM_PREFERRED_TYPE(
bool)
247 LLVM_PREFERRED_TYPE(
bool)
251 LLVM_PREFERRED_TYPE(
bool)
255 LLVM_PREFERRED_TYPE(
bool)
260 LLVM_PREFERRED_TYPE(
bool)
265 LLVM_PREFERRED_TYPE(
bool)
273 LLVM_PREFERRED_TYPE(
bool)
279 LLVM_PREFERRED_TYPE(
bool)
284 LLVM_PREFERRED_TYPE(
bool)
289 LLVM_PREFERRED_TYPE(
bool)
293 LLVM_PREFERRED_TYPE(
bool)
299 LLVM_PREFERRED_TYPE(
bool)
300 unsigned MSVCFormatting : 1;
318 LLVM_PREFERRED_TYPE(
bool)
319 unsigned ConstantsAsWritten : 1;
322 LLVM_PREFERRED_TYPE(
bool)
323 unsigned SuppressImplicitBase : 1;
327 LLVM_PREFERRED_TYPE(
bool)
328 unsigned FullyQualifiedName : 1;
331 LLVM_PREFERRED_TYPE(
bool)
332 unsigned PrintAsCanonical : 1;
337 LLVM_PREFERRED_TYPE(
bool)
338 unsigned PrintInjectedClassNameWithArguments : 1;
342 LLVM_PREFERRED_TYPE(
bool)
343 unsigned UsePreferredNames : 1;
347 LLVM_PREFERRED_TYPE(
bool)
348 unsigned AlwaysIncludeTypeForTemplateArgument : 1;
353 LLVM_PREFERRED_TYPE(
bool)
354 unsigned CleanUglifiedParameters : 1;
360 LLVM_PREFERRED_TYPE(
bool)
365 LLVM_PREFERRED_TYPE(
bool)
370 LLVM_PREFERRED_TYPE(
bool)
375 LLVM_PREFERRED_TYPE(
bool)
380 LLVM_PREFERRED_TYPE(
bool)
384 LLVM_PREFERRED_TYPE(
bool)
388 LLVM_PREFERRED_TYPE(
bool)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
virtual bool handledStmt(Stmt *E, raw_ostream &OS)=0
Callbacks to use to customize the behavior of the pretty-printer.
virtual std::string remapPath(StringRef Path) const
Remap a path to a form suitable for printing.
virtual bool isScopeVisible(const DeclContext *DC) const
When printing type to be inserted into code in specific context, this callback can be used to avoid p...
~PrintingCallbacks()=default
Stmt - This represents one statement.
Top level wrappers for InstallAPI frontend operations.
Diagnostic wrappers for TextAPI types for error reporting.
__builtin_elementwise_add_sat __builtin_elementwise_sub_sat uint32_t __packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
unsigned SuppressUnwrittenScope
Suppress printing parts of scope specifiers that are never written, e.g., for anonymous namespaces.
unsigned SuppressDeclAttributes
Whether to suppress attributes in decl printing.
unsigned PrettyEnums
Whether to print enumerators with a matching enumerator name or via cast.
unsigned SuppressDefaultTemplateArgs
When true, attempt to suppress template arguments that match the default argument for the parameter.
unsigned SplitTemplateClosers
Whether nested templates must be closed like 'a<b<c> >' rather than 'a<b<c>>'.
unsigned PolishForDeclaration
When true, do certain refinement needed for producing proper declaration tag; such as,...
void adjustForCPlusPlus()
Adjust this printing policy for cases where it's known that we're printing C++ code (for instance,...
unsigned UseVoidForZeroParams
Whether we should use '(void)' rather than '()' for a function prototype with zero parameters.
unsigned Alignof
Whether we can use 'alignof' rather than '__alignof'.
unsigned SuppressSpecifiers
Whether we should suppress printing of the actual specifiers for the given type or declaration.
unsigned Nullptr
Whether we should use 'nullptr' rather than '0' as a null pointer constant.
unsigned ConstantArraySizeAsWritten
Whether we should print the sizes of constant array expressions as written in the sources.
unsigned SuppressTagKeyword
Whether type printing should skip printing the tag keyword.
unsigned Bool
Whether we can use 'bool' rather than '_Bool' (even if the language doesn't actually have 'bool',...
unsigned SuppressStrongLifetime
When true, suppress printing of the __strong lifetime qualifier in ARC.
SuppressInlineNamespaceMode
unsigned Restrict
Whether we can use 'restrict' rather than '__restrict'.
unsigned UseEnumerators
Whether to print enumerator non-type template parameters with a matching enumerator name or via cast ...
unsigned UseHLSLTypes
Whether or not we're printing known HLSL code and should print HLSL sugared types when possible.
unsigned NullptrTypeInNamespace
Whether 'nullptr_t' is in namespace 'std' or not.
unsigned SuppressInlineNamespace
Suppress printing parts of scope specifiers that correspond to inline namespaces.
unsigned SuppressScope
Suppresses printing of scope specifiers.
unsigned EntireContentsOfLargeArray
Whether to print the entire array initializers, especially on non-type template parameters,...
const PrintingCallbacks * Callbacks
Callbacks to use to allow the behavior of printing to be customized.
unsigned IncludeNewlines
When true, include newlines after statements like "break", etc.
AnonymousTagMode
Dictates how anonymous/unnamed entities are printed.
@ Plain
E.g., (anonymous enum)/(unnamed struct)/etc.
@ SourceLocation
When printing an anonymous tag name, also print the location of that entity (e.g.,...
unsigned Indentation
The number of spaces to use to indent each line.
unsigned Half
When true, print the half-precision floating-point type as 'half' instead of '__fp16'.
PrintingPolicy(const LangOptions &LO)
Create a default printing policy for the specified language.
unsigned SuppressInitializers
Suppress printing of variable initializers.
unsigned IncludeTagDefinition
When true, include the body of a tag definition.
unsigned TerseOutput
Provide a 'terse' output.
unsigned SuppressTemplateArgsInCXXConstructors
When true, suppresses printing template arguments in names of C++ constructors.
unsigned SuppressTagKeywordInAnonNames
Whether type printing should skip printing the tag keyword of anonymous entities.
unsigned SuppressLambdaBody
Whether to suppress printing the body of a lambda.
unsigned UnderscoreAlignof
Whether we can use '_Alignof' rather than '__alignof'.
unsigned MSWChar
When true, print the built-in wchar_t type as __wchar_t.
unsigned SuppressLifetimeQualifiers
When true, suppress printing of lifetime qualifier in ARC.
unsigned ResolveDecltype
Use whitespace and punctuation like MSVC does.
unsigned AnonymousTagNameStyle