@@ -57,11 +57,14 @@ class PrintingCallbacks {
5757// / It is very frequently copied.
5858struct PrintingPolicy {
5959 enum class SuppressInlineNamespaceMode : uint8_t { None, Redundant, All };
60+ enum class SuppressTagKeywordMode : uint8_t { None, InElaboratedNames };
6061
6162 // / Create a default printing policy for the specified language.
6263 PrintingPolicy (const LangOptions &LO)
6364 : Indentation(2 ), SuppressSpecifiers(false ),
64- SuppressTagKeyword (LO.CPlusPlus),
65+ SuppressTagKeyword (llvm::to_underlying(
66+ LO.CPlusPlus ? SuppressTagKeywordMode::InElaboratedNames
67+ : SuppressTagKeywordMode::None)),
6568 SuppressTagKeywordInAnonymousTagNames(false ),
6669 IncludeTagDefinition(false ), SuppressScope(false ),
6770 SuppressUnwrittenScope(false ),
@@ -90,7 +93,8 @@ struct PrintingPolicy {
9093 // / construct). This should not be used if a real LangOptions object is
9194 // / available.
9295 void adjustForCPlusPlus () {
93- SuppressTagKeyword = true ;
96+ SuppressTagKeyword =
97+ llvm::to_underlying (SuppressTagKeywordMode::InElaboratedNames);
9498 Bool = true ;
9599 UseVoidForZeroParams = false ;
96100 }
@@ -123,7 +127,7 @@ struct PrintingPolicy {
123127 // / \code
124128 // / struct Geometry::Point;
125129 // / \endcode
126- LLVM_PREFERRED_TYPE (bool )
130+ LLVM_PREFERRED_TYPE (SuppressTagKeywordMode )
127131 unsigned SuppressTagKeyword : 1;
128132 unsigned SuppressTagKeywordInAnonymousTagNames : 1 ;
129133
0 commit comments