10b57cec5SDimitry Andric //===--- PrettyPrinter.h - Classes for aiding with AST printing -*- C++ -*-===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 9480093f4SDimitry Andric // This file defines helper types for AST pretty-printing. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #ifndef LLVM_CLANG_AST_PRETTYPRINTER_H 140b57cec5SDimitry Andric #define LLVM_CLANG_AST_PRETTYPRINTER_H 150b57cec5SDimitry Andric 160b57cec5SDimitry Andric #include "clang/Basic/LLVM.h" 170b57cec5SDimitry Andric #include "clang/Basic/LangOptions.h" 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric namespace clang { 200b57cec5SDimitry Andric 21e8d8bef9SDimitry Andric class DeclContext; 220b57cec5SDimitry Andric class LangOptions; 230b57cec5SDimitry Andric class Stmt; 240b57cec5SDimitry Andric 250b57cec5SDimitry Andric class PrinterHelper { 260b57cec5SDimitry Andric public: 270b57cec5SDimitry Andric virtual ~PrinterHelper(); 280b57cec5SDimitry Andric virtual bool handledStmt(Stmt* E, raw_ostream& OS) = 0; 290b57cec5SDimitry Andric }; 300b57cec5SDimitry Andric 31480093f4SDimitry Andric /// Callbacks to use to customize the behavior of the pretty-printer. 32480093f4SDimitry Andric class PrintingCallbacks { 33480093f4SDimitry Andric protected: 34480093f4SDimitry Andric ~PrintingCallbacks() = default; 35480093f4SDimitry Andric 36480093f4SDimitry Andric public: 37480093f4SDimitry Andric /// Remap a path to a form suitable for printing. 385ffd83dbSDimitry Andric virtual std::string remapPath(StringRef Path) const { 395ffd83dbSDimitry Andric return std::string(Path); 405ffd83dbSDimitry Andric } 41e8d8bef9SDimitry Andric 42e8d8bef9SDimitry Andric /// When printing type to be inserted into code in specific context, this 43e8d8bef9SDimitry Andric /// callback can be used to avoid printing the redundant part of the 44e8d8bef9SDimitry Andric /// qualifier. For example, when inserting code inside namespace foo, we 45e8d8bef9SDimitry Andric /// should print bar::SomeType instead of foo::bar::SomeType. 46e8d8bef9SDimitry Andric /// To do this, shouldPrintScope should return true on "foo" NamespaceDecl. 47e8d8bef9SDimitry Andric /// The printing stops at the first isScopeVisible() == true, so there will 48e8d8bef9SDimitry Andric /// be no calls with outer scopes. 49e8d8bef9SDimitry Andric virtual bool isScopeVisible(const DeclContext *DC) const { return false; } 50480093f4SDimitry Andric }; 51480093f4SDimitry Andric 520b57cec5SDimitry Andric /// Describes how types, statements, expressions, and declarations should be 530b57cec5SDimitry Andric /// printed. 540b57cec5SDimitry Andric /// 550b57cec5SDimitry Andric /// This type is intended to be small and suitable for passing by value. 560b57cec5SDimitry Andric /// It is very frequently copied. 570b57cec5SDimitry Andric struct PrintingPolicy { 580b57cec5SDimitry Andric /// Create a default printing policy for the specified language. 590b57cec5SDimitry Andric PrintingPolicy(const LangOptions &LO) 600b57cec5SDimitry Andric : Indentation(2), SuppressSpecifiers(false), 610b57cec5SDimitry Andric SuppressTagKeyword(LO.CPlusPlus), IncludeTagDefinition(false), 620b57cec5SDimitry Andric SuppressScope(false), SuppressUnwrittenScope(false), 6306c3fb27SDimitry Andric SuppressInlineNamespace(true), SuppressElaboration(false), 6406c3fb27SDimitry Andric SuppressInitializers(false), ConstantArraySizeAsWritten(false), 6506c3fb27SDimitry Andric AnonymousTagLocations(true), SuppressStrongLifetime(false), 6606c3fb27SDimitry Andric SuppressLifetimeQualifiers(false), 67e8d8bef9SDimitry Andric SuppressTemplateArgsInCXXConstructors(false), 68e8d8bef9SDimitry Andric SuppressDefaultTemplateArgs(true), Bool(LO.Bool), 695f757f3fSDimitry Andric Nullptr(LO.CPlusPlus11 || LO.C23), NullptrTypeInNamespace(LO.CPlusPlus), 7006c3fb27SDimitry Andric Restrict(LO.C99), Alignof(LO.CPlusPlus11), UnderscoreAlignof(LO.C11), 7106c3fb27SDimitry Andric UseVoidForZeroParams(!LO.CPlusPlus), 725ffd83dbSDimitry Andric SplitTemplateClosers(!LO.CPlusPlus11), TerseOutput(false), 730b57cec5SDimitry Andric PolishForDeclaration(false), Half(LO.Half), 740b57cec5SDimitry Andric MSWChar(LO.MicrosoftExt && !LO.WChar), IncludeNewlines(true), 750b57cec5SDimitry Andric MSVCFormatting(false), ConstantsAsWritten(false), 760b57cec5SDimitry Andric SuppressImplicitBase(false), FullyQualifiedName(false), 77349cc55cSDimitry Andric PrintCanonicalTypes(false), PrintInjectedClassNameWithArguments(true), 7804eeddc0SDimitry Andric UsePreferredNames(true), AlwaysIncludeTypeForTemplateArgument(false), 7981ad6265SDimitry Andric CleanUglifiedParameters(false), EntireContentsOfLargeArray(true), 80*0fca6ea1SDimitry Andric UseEnumerators(true), UseHLSLTypes(LO.HLSL) {} 810b57cec5SDimitry Andric 820b57cec5SDimitry Andric /// Adjust this printing policy for cases where it's known that we're 830b57cec5SDimitry Andric /// printing C++ code (for instance, if AST dumping reaches a C++-only 840b57cec5SDimitry Andric /// construct). This should not be used if a real LangOptions object is 850b57cec5SDimitry Andric /// available. 860b57cec5SDimitry Andric void adjustForCPlusPlus() { 870b57cec5SDimitry Andric SuppressTagKeyword = true; 880b57cec5SDimitry Andric Bool = true; 890b57cec5SDimitry Andric UseVoidForZeroParams = false; 900b57cec5SDimitry Andric } 910b57cec5SDimitry Andric 920b57cec5SDimitry Andric /// The number of spaces to use to indent each line. 930b57cec5SDimitry Andric unsigned Indentation : 8; 940b57cec5SDimitry Andric 950b57cec5SDimitry Andric /// Whether we should suppress printing of the actual specifiers for 960b57cec5SDimitry Andric /// the given type or declaration. 970b57cec5SDimitry Andric /// 980b57cec5SDimitry Andric /// This flag is only used when we are printing declarators beyond 990b57cec5SDimitry Andric /// the first declarator within a declaration group. For example, given: 1000b57cec5SDimitry Andric /// 1010b57cec5SDimitry Andric /// \code 1020b57cec5SDimitry Andric /// const int *x, *y; 1030b57cec5SDimitry Andric /// \endcode 1040b57cec5SDimitry Andric /// 1050b57cec5SDimitry Andric /// SuppressSpecifiers will be false when printing the 1060b57cec5SDimitry Andric /// declaration for "x", so that we will print "int *x"; it will be 1070b57cec5SDimitry Andric /// \c true when we print "y", so that we suppress printing the 1080b57cec5SDimitry Andric /// "const int" type specifier and instead only print the "*y". 1095f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1100b57cec5SDimitry Andric unsigned SuppressSpecifiers : 1; 1110b57cec5SDimitry Andric 1120b57cec5SDimitry Andric /// Whether type printing should skip printing the tag keyword. 1130b57cec5SDimitry Andric /// 1140b57cec5SDimitry Andric /// This is used when printing the inner type of elaborated types, 1150b57cec5SDimitry Andric /// (as the tag keyword is part of the elaborated type): 1160b57cec5SDimitry Andric /// 1170b57cec5SDimitry Andric /// \code 1180b57cec5SDimitry Andric /// struct Geometry::Point; 1190b57cec5SDimitry Andric /// \endcode 1205f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1210b57cec5SDimitry Andric unsigned SuppressTagKeyword : 1; 1220b57cec5SDimitry Andric 1230b57cec5SDimitry Andric /// When true, include the body of a tag definition. 1240b57cec5SDimitry Andric /// 1250b57cec5SDimitry Andric /// This is used to place the definition of a struct 1260b57cec5SDimitry Andric /// in the middle of another declaration as with: 1270b57cec5SDimitry Andric /// 1280b57cec5SDimitry Andric /// \code 1290b57cec5SDimitry Andric /// typedef struct { int x, y; } Point; 1300b57cec5SDimitry Andric /// \endcode 1315f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1320b57cec5SDimitry Andric unsigned IncludeTagDefinition : 1; 1330b57cec5SDimitry Andric 1340b57cec5SDimitry Andric /// Suppresses printing of scope specifiers. 1355f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1360b57cec5SDimitry Andric unsigned SuppressScope : 1; 1370b57cec5SDimitry Andric 138e8d8bef9SDimitry Andric /// Suppress printing parts of scope specifiers that are never 139e8d8bef9SDimitry Andric /// written, e.g., for anonymous namespaces. 1405f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1410b57cec5SDimitry Andric unsigned SuppressUnwrittenScope : 1; 1420b57cec5SDimitry Andric 143e8d8bef9SDimitry Andric /// Suppress printing parts of scope specifiers that correspond 144e8d8bef9SDimitry Andric /// to inline namespaces, where the name is unambiguous with the specifier 145e8d8bef9SDimitry Andric /// removed. 1465f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 147e8d8bef9SDimitry Andric unsigned SuppressInlineNamespace : 1; 148e8d8bef9SDimitry Andric 14906c3fb27SDimitry Andric /// Ignore qualifiers and tag keywords as specified by elaborated type sugar, 15006c3fb27SDimitry Andric /// instead letting the underlying type print as normal. 1515f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 15206c3fb27SDimitry Andric unsigned SuppressElaboration : 1; 15306c3fb27SDimitry Andric 1540b57cec5SDimitry Andric /// Suppress printing of variable initializers. 1550b57cec5SDimitry Andric /// 1560b57cec5SDimitry Andric /// This flag is used when printing the loop variable in a for-range 1570b57cec5SDimitry Andric /// statement. For example, given: 1580b57cec5SDimitry Andric /// 1590b57cec5SDimitry Andric /// \code 1600b57cec5SDimitry Andric /// for (auto x : coll) 1610b57cec5SDimitry Andric /// \endcode 1620b57cec5SDimitry Andric /// 1630b57cec5SDimitry Andric /// SuppressInitializers will be true when printing "auto x", so that the 1640b57cec5SDimitry Andric /// internal initializer constructed for x will not be printed. 1655f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1660b57cec5SDimitry Andric unsigned SuppressInitializers : 1; 1670b57cec5SDimitry Andric 1680b57cec5SDimitry Andric /// Whether we should print the sizes of constant array expressions as written 1690b57cec5SDimitry Andric /// in the sources. 1700b57cec5SDimitry Andric /// 1710b57cec5SDimitry Andric /// This flag determines whether array types declared as 1720b57cec5SDimitry Andric /// 1730b57cec5SDimitry Andric /// \code 1740b57cec5SDimitry Andric /// int a[4+10*10]; 1750b57cec5SDimitry Andric /// char a[] = "A string"; 1760b57cec5SDimitry Andric /// \endcode 1770b57cec5SDimitry Andric /// 1780b57cec5SDimitry Andric /// will be printed as written or as follows: 1790b57cec5SDimitry Andric /// 1800b57cec5SDimitry Andric /// \code 1810b57cec5SDimitry Andric /// int a[104]; 1820b57cec5SDimitry Andric /// char a[9] = "A string"; 1830b57cec5SDimitry Andric /// \endcode 1845f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1850b57cec5SDimitry Andric unsigned ConstantArraySizeAsWritten : 1; 1860b57cec5SDimitry Andric 1870b57cec5SDimitry Andric /// When printing an anonymous tag name, also print the location of that 1880b57cec5SDimitry Andric /// entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just prints 1890b57cec5SDimitry Andric /// "(anonymous)" for the name. 1905f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1910b57cec5SDimitry Andric unsigned AnonymousTagLocations : 1; 1920b57cec5SDimitry Andric 1930b57cec5SDimitry Andric /// When true, suppress printing of the __strong lifetime qualifier in ARC. 1945f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1950b57cec5SDimitry Andric unsigned SuppressStrongLifetime : 1; 1960b57cec5SDimitry Andric 1970b57cec5SDimitry Andric /// When true, suppress printing of lifetime qualifier in ARC. 1985f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 1990b57cec5SDimitry Andric unsigned SuppressLifetimeQualifiers : 1; 2000b57cec5SDimitry Andric 2010b57cec5SDimitry Andric /// When true, suppresses printing template arguments in names of C++ 2020b57cec5SDimitry Andric /// constructors. 2035f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2040b57cec5SDimitry Andric unsigned SuppressTemplateArgsInCXXConstructors : 1; 2050b57cec5SDimitry Andric 206e8d8bef9SDimitry Andric /// When true, attempt to suppress template arguments that match the default 207e8d8bef9SDimitry Andric /// argument for the parameter. 2085f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 209e8d8bef9SDimitry Andric unsigned SuppressDefaultTemplateArgs : 1; 210e8d8bef9SDimitry Andric 2110b57cec5SDimitry Andric /// Whether we can use 'bool' rather than '_Bool' (even if the language 2120b57cec5SDimitry Andric /// doesn't actually have 'bool', because, e.g., it is defined as a macro). 2135f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2140b57cec5SDimitry Andric unsigned Bool : 1; 2150b57cec5SDimitry Andric 216e8d8bef9SDimitry Andric /// Whether we should use 'nullptr' rather than '0' as a null pointer 217e8d8bef9SDimitry Andric /// constant. 2185f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 219e8d8bef9SDimitry Andric unsigned Nullptr : 1; 220e8d8bef9SDimitry Andric 221bdd1243dSDimitry Andric /// Whether 'nullptr_t' is in namespace 'std' or not. 2225f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 223bdd1243dSDimitry Andric unsigned NullptrTypeInNamespace : 1; 224bdd1243dSDimitry Andric 2250b57cec5SDimitry Andric /// Whether we can use 'restrict' rather than '__restrict'. 2265f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2270b57cec5SDimitry Andric unsigned Restrict : 1; 2280b57cec5SDimitry Andric 2290b57cec5SDimitry Andric /// Whether we can use 'alignof' rather than '__alignof'. 2305f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2310b57cec5SDimitry Andric unsigned Alignof : 1; 2320b57cec5SDimitry Andric 2330b57cec5SDimitry Andric /// Whether we can use '_Alignof' rather than '__alignof'. 2345f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2350b57cec5SDimitry Andric unsigned UnderscoreAlignof : 1; 2360b57cec5SDimitry Andric 2370b57cec5SDimitry Andric /// Whether we should use '(void)' rather than '()' for a function prototype 2380b57cec5SDimitry Andric /// with zero parameters. 2395f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2400b57cec5SDimitry Andric unsigned UseVoidForZeroParams : 1; 2410b57cec5SDimitry Andric 2425ffd83dbSDimitry Andric /// Whether nested templates must be closed like 'a\<b\<c\> \>' rather than 2435ffd83dbSDimitry Andric /// 'a\<b\<c\>\>'. 2445f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2455ffd83dbSDimitry Andric unsigned SplitTemplateClosers : 1; 2465ffd83dbSDimitry Andric 2470b57cec5SDimitry Andric /// Provide a 'terse' output. 2480b57cec5SDimitry Andric /// 2490b57cec5SDimitry Andric /// For example, in this mode we don't print function bodies, class members, 2500b57cec5SDimitry Andric /// declarations inside namespaces etc. Effectively, this should print 2510b57cec5SDimitry Andric /// only the requested declaration. 2525f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2530b57cec5SDimitry Andric unsigned TerseOutput : 1; 2540b57cec5SDimitry Andric 2550b57cec5SDimitry Andric /// When true, do certain refinement needed for producing proper declaration 2560b57cec5SDimitry Andric /// tag; such as, do not print attributes attached to the declaration. 2570b57cec5SDimitry Andric /// 2585f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2590b57cec5SDimitry Andric unsigned PolishForDeclaration : 1; 2600b57cec5SDimitry Andric 2610b57cec5SDimitry Andric /// When true, print the half-precision floating-point type as 'half' 2620b57cec5SDimitry Andric /// instead of '__fp16' 2635f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2640b57cec5SDimitry Andric unsigned Half : 1; 2650b57cec5SDimitry Andric 2660b57cec5SDimitry Andric /// When true, print the built-in wchar_t type as __wchar_t. For use in 2670b57cec5SDimitry Andric /// Microsoft mode when wchar_t is not available. 2685f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2690b57cec5SDimitry Andric unsigned MSWChar : 1; 2700b57cec5SDimitry Andric 2710b57cec5SDimitry Andric /// When true, include newlines after statements like "break", etc. 2725f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2730b57cec5SDimitry Andric unsigned IncludeNewlines : 1; 2740b57cec5SDimitry Andric 2750b57cec5SDimitry Andric /// Use whitespace and punctuation like MSVC does. In particular, this prints 2760b57cec5SDimitry Andric /// anonymous namespaces as `anonymous namespace' and does not insert spaces 2770b57cec5SDimitry Andric /// after template arguments. 2785f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2790b57cec5SDimitry Andric unsigned MSVCFormatting : 1; 2800b57cec5SDimitry Andric 2810b57cec5SDimitry Andric /// Whether we should print the constant expressions as written in the 2820b57cec5SDimitry Andric /// sources. 2830b57cec5SDimitry Andric /// 2840b57cec5SDimitry Andric /// This flag determines whether constants expressions like 2850b57cec5SDimitry Andric /// 2860b57cec5SDimitry Andric /// \code 2870b57cec5SDimitry Andric /// 0x10 2880b57cec5SDimitry Andric /// 2.5e3 2890b57cec5SDimitry Andric /// \endcode 2900b57cec5SDimitry Andric /// 2910b57cec5SDimitry Andric /// will be printed as written or as follows: 2920b57cec5SDimitry Andric /// 2930b57cec5SDimitry Andric /// \code 2940b57cec5SDimitry Andric /// 0x10 2950b57cec5SDimitry Andric /// 2.5e3 2960b57cec5SDimitry Andric /// \endcode 2975f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 2980b57cec5SDimitry Andric unsigned ConstantsAsWritten : 1; 2990b57cec5SDimitry Andric 3000b57cec5SDimitry Andric /// When true, don't print the implicit 'self' or 'this' expressions. 3015f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 3020b57cec5SDimitry Andric unsigned SuppressImplicitBase : 1; 3030b57cec5SDimitry Andric 3040b57cec5SDimitry Andric /// When true, print the fully qualified name of function declarations. 3050b57cec5SDimitry Andric /// This is the opposite of SuppressScope and thus overrules it. 3065f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 3070b57cec5SDimitry Andric unsigned FullyQualifiedName : 1; 3080b57cec5SDimitry Andric 3090b57cec5SDimitry Andric /// Whether to print types as written or canonically. 3105f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 3110b57cec5SDimitry Andric unsigned PrintCanonicalTypes : 1; 3120b57cec5SDimitry Andric 3135ffd83dbSDimitry Andric /// Whether to print an InjectedClassNameType with template arguments or as 3145ffd83dbSDimitry Andric /// written. When a template argument is unnamed, printing it results in 3155ffd83dbSDimitry Andric /// invalid C++ code. 3165f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 3175ffd83dbSDimitry Andric unsigned PrintInjectedClassNameWithArguments : 1; 3185ffd83dbSDimitry Andric 319349cc55cSDimitry Andric /// Whether to use C++ template preferred_name attributes when printing 320349cc55cSDimitry Andric /// templates. 3215f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 322349cc55cSDimitry Andric unsigned UsePreferredNames : 1; 323349cc55cSDimitry Andric 324349cc55cSDimitry Andric /// Whether to use type suffixes (eg: 1U) on integral non-type template 325349cc55cSDimitry Andric /// parameters. 3265f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 327349cc55cSDimitry Andric unsigned AlwaysIncludeTypeForTemplateArgument : 1; 328349cc55cSDimitry Andric 32904eeddc0SDimitry Andric /// Whether to strip underscores when printing reserved parameter names. 33004eeddc0SDimitry Andric /// e.g. std::vector<class _Tp> becomes std::vector<class Tp>. 33104eeddc0SDimitry Andric /// This only affects parameter names, and so describes a compatible API. 3325f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 33304eeddc0SDimitry Andric unsigned CleanUglifiedParameters : 1; 33404eeddc0SDimitry Andric 33581ad6265SDimitry Andric /// Whether to print the entire array initializers, especially on non-type 33681ad6265SDimitry Andric /// template parameters, no matter how many elements there are. 3375f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 33881ad6265SDimitry Andric unsigned EntireContentsOfLargeArray : 1; 33981ad6265SDimitry Andric 34081ad6265SDimitry Andric /// Whether to print enumerator non-type template parameters with a matching 34181ad6265SDimitry Andric /// enumerator name or via cast of an integer. 3425f757f3fSDimitry Andric LLVM_PREFERRED_TYPE(bool) 34381ad6265SDimitry Andric unsigned UseEnumerators : 1; 34481ad6265SDimitry Andric 345*0fca6ea1SDimitry Andric /// Whether or not we're printing known HLSL code and should print HLSL 346*0fca6ea1SDimitry Andric /// sugared types when possible. 347*0fca6ea1SDimitry Andric LLVM_PREFERRED_TYPE(bool) 348*0fca6ea1SDimitry Andric unsigned UseHLSLTypes : 1; 349*0fca6ea1SDimitry Andric 350480093f4SDimitry Andric /// Callbacks to use to allow the behavior of printing to be customized. 351480093f4SDimitry Andric const PrintingCallbacks *Callbacks = nullptr; 3520b57cec5SDimitry Andric }; 3530b57cec5SDimitry Andric 3540b57cec5SDimitry Andric } // end namespace clang 3550b57cec5SDimitry Andric 3560b57cec5SDimitry Andric #endif 357