Skip to content

Commit 4f96ce4

Browse files
committed
[clang][NFC] Convert Sema::PragmaClangSectionAction to scoped enum
1 parent b10296e commit 4f96ce4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ enum class PragmaClangSectionKind {
473473
Relro = 5
474474
};
475475

476+
enum class PragmaClangSectionAction { Set = 0, Clear = 1 };
477+
476478
/// Sema - This implements semantic analysis and AST building for C.
477479
/// \nosubgrouping
478480
class Sema final : public SemaBase {
@@ -1422,8 +1424,6 @@ class Sema final : public SemaBase {
14221424
/// Source location for newly created implicit MSInheritanceAttrs
14231425
SourceLocation ImplicitMSInheritanceAttrLoc;
14241426

1425-
enum PragmaClangSectionAction { PCSA_Set = 0, PCSA_Clear = 1 };
1426-
14271427
struct PragmaClangSection {
14281428
std::string SectionName;
14291429
bool Valid = false;

clang/lib/Parse/ParsePragma.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2350,11 +2350,11 @@ void PragmaClangSectionHandler::HandlePragma(Preprocessor &PP,
23502350
if (!PP.LexStringLiteral(Tok, SecName, "pragma clang section", false))
23512351
return;
23522352

2353-
Actions.ActOnPragmaClangSection(
2354-
PragmaLocation,
2355-
(SecName.size() ? Sema::PragmaClangSectionAction::PCSA_Set
2356-
: Sema::PragmaClangSectionAction::PCSA_Clear),
2357-
SecKind, SecName);
2353+
Actions.ActOnPragmaClangSection(PragmaLocation,
2354+
(SecName.size()
2355+
? PragmaClangSectionAction::Set
2356+
: PragmaClangSectionAction::Clear),
2357+
SecKind, SecName);
23582358
}
23592359
}
23602360

clang/lib/Sema/SemaAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void Sema::ActOnPragmaClangSection(SourceLocation PragmaLoc,
415415
llvm_unreachable("invalid clang section kind");
416416
}
417417

418-
if (Action == PragmaClangSectionAction::PCSA_Clear) {
418+
if (Action == PragmaClangSectionAction::Clear) {
419419
CSec->Valid = false;
420420
return;
421421
}

0 commit comments

Comments
 (0)