@@ -1058,7 +1058,7 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
10581058 // / Returns true if a variable with function scope is a non-static local
10591059 // / variable.
10601060 bool hasLocalStorage () const {
1061- if (getStorageClass () == StorageClass::None ) {
1061+ if (getStorageClass () == SC_None ) {
10621062 // OpenCL v1.2 s6.5.3: The __constant or constant address space name is
10631063 // used to describe variables allocated in global memory and which are
10641064 // accessed inside a kernel(s) as read-only variables. As such, variables
@@ -1070,40 +1070,29 @@ class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
10701070 }
10711071
10721072 // Global Named Register (GNU extension)
1073- if (getStorageClass () == StorageClass::Register && !isLocalVarDeclOrParm ())
1073+ if (getStorageClass () == SC_Register && !isLocalVarDeclOrParm ())
10741074 return false ;
10751075
10761076 // Return true for: Auto, Register.
10771077 // Return false for: Extern, Static, PrivateExtern, OpenCLWorkGroupLocal.
10781078
1079- switch (getStorageClass ()) {
1080- case StorageClass::Auto:
1081- case StorageClass::Register:
1082- return true ;
1083- case StorageClass::Extern:
1084- case StorageClass::None:
1085- case StorageClass::PrivateExtern:
1086- case StorageClass::Static:
1087- return false ;
1088- }
1089- llvm_unreachable (" unknown storage class" );
1079+ return getStorageClass () >= SC_Auto;
10901080 }
10911081
10921082 // / Returns true if a variable with function scope is a static local
10931083 // / variable.
10941084 bool isStaticLocal () const {
1095- return (getStorageClass () == StorageClass::Static ||
1085+ return (getStorageClass () == SC_Static ||
10961086 // C++11 [dcl.stc]p4
1097- (getStorageClass () == StorageClass::None &&
1098- getTSCSpec () == TSCS_thread_local)) &&
1099- !isFileVarDecl ();
1087+ (getStorageClass () == SC_None && getTSCSpec () == TSCS_thread_local))
1088+ && !isFileVarDecl ();
11001089 }
11011090
11021091 // / Returns true if a variable has extern or __private_extern__
11031092 // / storage.
11041093 bool hasExternalStorage () const {
1105- return getStorageClass () == StorageClass::Extern ||
1106- getStorageClass () == StorageClass::PrivateExtern ;
1094+ return getStorageClass () == SC_Extern ||
1095+ getStorageClass () == SC_PrivateExtern ;
11071096 }
11081097
11091098 // / Returns true for all variables that do not have local storage.
@@ -1605,15 +1594,15 @@ class ImplicitParamDecl : public VarDecl {
16051594 IdentifierInfo *Id, QualType Type,
16061595 ImplicitParamKind ParamKind)
16071596 : VarDecl(ImplicitParam, C, DC, IdLoc, IdLoc, Id, Type,
1608- /* TInfo=*/ nullptr , StorageClass::None ) {
1597+ /* TInfo=*/ nullptr , SC_None ) {
16091598 NonParmVarDeclBits.ImplicitParamKind = ParamKind;
16101599 setImplicit ();
16111600 }
16121601
16131602 ImplicitParamDecl (ASTContext &C, QualType Type, ImplicitParamKind ParamKind)
16141603 : VarDecl(ImplicitParam, C, /* DC=*/ nullptr , SourceLocation(),
16151604 SourceLocation (), /* Id=*/ nullptr, Type,
1616- /* TInfo=*/ nullptr, StorageClass::None ) {
1605+ /* TInfo=*/ nullptr, SC_None ) {
16171606 NonParmVarDeclBits.ImplicitParamKind = ParamKind;
16181607 setImplicit ();
16191608 }
@@ -2550,7 +2539,7 @@ class FunctionDecl : public DeclaratorDecl,
25502539
25512540 // / Sets the storage class as written in the source.
25522541 void setStorageClass (StorageClass SClass) {
2553- FunctionDeclBits.SClass = static_cast < uint64_t >( SClass) ;
2542+ FunctionDeclBits.SClass = SClass;
25542543 }
25552544
25562545 // / Determine whether the "inline" keyword was specified for this
@@ -2577,7 +2566,7 @@ class FunctionDecl : public DeclaratorDecl,
25772566
25782567 bool doesDeclarationForceExternallyVisibleDefinition () const ;
25792568
2580- bool isStatic () const { return getStorageClass () == StorageClass::Static ; }
2569+ bool isStatic () const { return getStorageClass () == SC_Static ; }
25812570
25822571 // / Whether this function declaration represents an C++ overloaded
25832572 // / operator, e.g., "operator+".
0 commit comments