Skip to content

Commit 871f5b0

Browse files
committed
Revert "Fix warning in MSVC"
This reverts commit 0323938.
1 parent 94f1c86 commit 871f5b0

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

clang/lib/AST/DeclPrinter.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -250,23 +250,13 @@ raw_ostream& DeclPrinter::Indent(unsigned Indentation) {
250250
return Out;
251251
}
252252

253-
// For CLANG_ATTR_LIST_CanPrintOnLeft macro.
254-
#include "clang/Basic/AttrLeftSideCanPrintList.inc"
255-
256-
// For CLANG_ATTR_LIST_PrintOnLeft macro.
257-
#include "clang/Basic/AttrLeftSideMustPrintList.inc"
258-
259253
static bool canPrintOnLeftSide(attr::Kind kind) {
260-
#ifdef CLANG_ATTR_LIST_CanPrintOnLeft
261254
switch (kind) {
262-
CLANG_ATTR_LIST_CanPrintOnLeft
255+
#include "clang/Basic/AttrLeftSideCanPrintList.inc"
263256
return true;
264257
default:
265258
return false;
266259
}
267-
#else
268-
return false;
269-
#endif
270260
}
271261

272262
static bool canPrintOnLeftSide(const Attr *A) {
@@ -278,16 +268,11 @@ static bool canPrintOnLeftSide(const Attr *A) {
278268

279269
static bool mustPrintOnLeftSide(attr::Kind kind) {
280270
switch (kind) {
281-
#ifdef CLANG_ATTR_LIST_PrintOnLeft
282-
switch (kind) {
283-
CLANG_ATTR_LIST_PrintOnLeft
271+
#include "clang/Basic/AttrLeftSideMustPrintList.inc"
284272
return true;
285273
default:
286274
return false;
287275
}
288-
#else
289-
return false;
290-
#endif
291276
}
292277

293278
static bool mustPrintOnLeftSide(const Attr *A) {
@@ -329,6 +314,7 @@ void DeclPrinter::prettyPrintAttributes(Decl *D, llvm::raw_ostream &Out,
329314
VD->getInitStyle() == VarDecl::CallInit)
330315
AttrLoc = AttrPrintLoc::Left;
331316
}
317+
332318
// Only print the side matches the user requested.
333319
if ((Loc & AttrLoc) != AttrPrintLoc::None)
334320
A->printPretty(Out, Policy);

clang/utils/TableGen/ClangAttrEmitter.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3327,24 +3327,15 @@ void EmitClangAttrPrintList(const std::string &FieldName, RecordKeeper &Records,
33273327

33283328
std::vector<Record *> Attrs = Records.getAllDerivedDefinitions("Attr");
33293329
std::vector<Record *> PragmaAttrs;
3330-
bool first = false;
3331-
33323330
for (auto *Attr : Attrs) {
33333331
if (!Attr->getValueAsBit("ASTNode"))
33343332
continue;
33353333

33363334
if (!Attr->getValueAsBit(FieldName))
33373335
continue;
33383336

3339-
if (!first) {
3340-
first = true;
3341-
OS << "#define CLANG_ATTR_LIST_" << FieldName;
3342-
}
3343-
3344-
OS << " \\\n case attr::" << Attr->getName() << ":";
3337+
OS << "case attr::" << Attr->getName() << ":\n";
33453338
}
3346-
3347-
OS << '\n';
33483339
}
33493340

33503341
// Emits the enumeration list for attributes.

0 commit comments

Comments
 (0)