[cfe-commits] r112156 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ include/clang/Frontend/ include/clang/Sema/ lib/AST/ lib/Checker/ lib/CodeGen/ lib/Index/ lib/Rewrite/ lib/Sema/ lib/Serialization/
John McCall
rjmccall at apple.com
Wed Aug 25 20:08:43 PDT 2010
Author: rjmccall
Date: Wed Aug 25 22:08:43 2010
New Revision: 112156
URL: http://llvm.org/viewvc/llvm-project?rev=112156&view=rev
Log:
De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h.
Modified:
cfe/trunk/include/clang/AST/Decl.h
cfe/trunk/include/clang/AST/DeclCXX.h
cfe/trunk/include/clang/AST/DeclTemplate.h
cfe/trunk/include/clang/Basic/Specifiers.h
cfe/trunk/include/clang/Frontend/DeclXML.def
cfe/trunk/include/clang/Sema/DelayedDiagnostic.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/lib/AST/DeclPrinter.cpp
cfe/trunk/lib/AST/StmtDumper.cpp
cfe/trunk/lib/Checker/BasicStore.cpp
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/Index/Entity.cpp
cfe/trunk/lib/Rewrite/RewriteObjC.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Wed Aug 25 22:08:43 2010
@@ -490,36 +490,11 @@
APValue Evaluated;
};
-// \brief Describes the kind of template specialization that a
-// particular template specialization declaration represents.
-enum TemplateSpecializationKind {
- /// This template specialization was formed from a template-id but
- /// has not yet been declared, defined, or instantiated.
- TSK_Undeclared = 0,
- /// This template specialization was implicitly instantiated from a
- /// template. (C++ [temp.inst]).
- TSK_ImplicitInstantiation,
- /// This template specialization was declared or defined by an
- /// explicit specialization (C++ [temp.expl.spec]) or partial
- /// specialization (C++ [temp.class.spec]).
- TSK_ExplicitSpecialization,
- /// This template specialization was instantiated from a template
- /// due to an explicit instantiation declaration request
- /// (C++0x [temp.explicit]).
- TSK_ExplicitInstantiationDeclaration,
- /// This template specialization was instantiated from a template
- /// due to an explicit instantiation definition request
- /// (C++ [temp.explicit]).
- TSK_ExplicitInstantiationDefinition
-};
-
/// VarDecl - An instance of this class is created to represent a variable
/// declaration or definition.
class VarDecl : public DeclaratorDecl, public Redeclarable<VarDecl> {
public:
- enum StorageClass {
- None, Auto, Register, Extern, Static, PrivateExtern
- };
+ typedef clang::StorageClass StorageClass;
/// getStorageClassSpecifierString - Return the string used to
/// specify the storage class \arg SC.
@@ -595,8 +570,14 @@
StorageClass getStorageClassAsWritten() const {
return (StorageClass) SClassAsWritten;
}
- void setStorageClass(StorageClass SC) { SClass = SC; }
- void setStorageClassAsWritten(StorageClass SC) { SClassAsWritten = SC; }
+ void setStorageClass(StorageClass SC) {
+ assert(isLegalForVariable(SC));
+ SClass = SC;
+ }
+ void setStorageClassAsWritten(StorageClass SC) {
+ assert(isLegalForVariable(SC));
+ SClassAsWritten = SC;
+ }
void setThreadSpecified(bool T) { ThreadSpecified = T; }
bool isThreadSpecified() const {
@@ -606,25 +587,26 @@
/// hasLocalStorage - Returns true if a variable with function scope
/// is a non-static local variable.
bool hasLocalStorage() const {
- if (getStorageClass() == None)
+ if (getStorageClass() == SC_None)
return !isFileVarDecl();
// Return true for: Auto, Register.
// Return false for: Extern, Static, PrivateExtern.
- return getStorageClass() <= Register;
+ return getStorageClass() >= SC_Auto;
}
/// isStaticLocal - Returns true if a variable with function scope is a
/// static local variable.
bool isStaticLocal() const {
- return getStorageClass() == Static && !isFileVarDecl();
+ return getStorageClass() == SC_Static && !isFileVarDecl();
}
/// hasExternStorage - Returns true if a variable has extern or
/// __private_extern__ storage.
bool hasExternalStorage() const {
- return getStorageClass() == Extern || getStorageClass() == PrivateExtern;
+ return getStorageClass() == SC_Extern ||
+ getStorageClass() == SC_PrivateExtern;
}
/// hasGlobalStorage - Returns true for all variables that do not
@@ -937,7 +919,7 @@
protected:
ImplicitParamDecl(Kind DK, DeclContext *DC, SourceLocation L,
IdentifierInfo *Id, QualType Tw)
- : VarDecl(DK, DC, L, Id, Tw, /*TInfo=*/0, VarDecl::None, VarDecl::None) {}
+ : VarDecl(DK, DC, L, Id, Tw, /*TInfo=*/0, SC_None, SC_None) {}
public:
static ImplicitParamDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation L, IdentifierInfo *Id,
@@ -1081,9 +1063,7 @@
class FunctionDecl : public DeclaratorDecl, public DeclContext,
public Redeclarable<FunctionDecl> {
public:
- enum StorageClass {
- None, Extern, Static, PrivateExtern
- };
+ typedef clang::StorageClass StorageClass;
/// \brief The kind of templated function a FunctionDecl can be.
enum TemplatedKind {
@@ -1178,8 +1158,8 @@
static FunctionDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L,
DeclarationName N, QualType T,
TypeSourceInfo *TInfo,
- StorageClass S = None,
- StorageClass SCAsWritten = None,
+ StorageClass S = SC_None,
+ StorageClass SCAsWritten = SC_None,
bool isInline = false,
bool hasWrittenPrototype = true) {
DeclarationNameInfo NameInfo(N, L);
@@ -1190,8 +1170,8 @@
static FunctionDecl *Create(ASTContext &C, DeclContext *DC,
const DeclarationNameInfo &NameInfo,
QualType T, TypeSourceInfo *TInfo,
- StorageClass S = None,
- StorageClass SCAsWritten = None,
+ StorageClass S = SC_None,
+ StorageClass SCAsWritten = SC_None,
bool isInline = false,
bool hasWrittenPrototype = true);
@@ -1372,12 +1352,18 @@
}
StorageClass getStorageClass() const { return StorageClass(SClass); }
- void setStorageClass(StorageClass SC) { SClass = SC; }
+ void setStorageClass(StorageClass SC) {
+ assert(isLegalForFunction(SC));
+ SClass = SC;
+ }
StorageClass getStorageClassAsWritten() const {
return StorageClass(SClassAsWritten);
}
- void setStorageClassAsWritten(StorageClass SC) { SClassAsWritten = SC; }
+ void setStorageClassAsWritten(StorageClass SC) {
+ assert(isLegalForFunction(SC));
+ SClassAsWritten = SC;
+ }
/// \brief Determine whether the "inline" keyword was specified for this
/// function.
Modified: cfe/trunk/include/clang/AST/DeclCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclCXX.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclCXX.h (original)
+++ cfe/trunk/include/clang/AST/DeclCXX.h Wed Aug 25 22:08:43 2010
@@ -1069,7 +1069,7 @@
const DeclarationNameInfo &NameInfo,
QualType T, TypeSourceInfo *TInfo,
bool isStatic, StorageClass SCAsWritten, bool isInline)
- : FunctionDecl(DK, RD, NameInfo, T, TInfo, (isStatic ? Static : None),
+ : FunctionDecl(DK, RD, NameInfo, T, TInfo, (isStatic ? SC_Static : SC_None),
SCAsWritten, isInline) {}
public:
@@ -1077,10 +1077,10 @@
const DeclarationNameInfo &NameInfo,
QualType T, TypeSourceInfo *TInfo,
bool isStatic = false,
- StorageClass SCAsWritten = FunctionDecl::None,
+ StorageClass SCAsWritten = SC_None,
bool isInline = false);
- bool isStatic() const { return getStorageClass() == Static; }
+ bool isStatic() const { return getStorageClass() == SC_Static; }
bool isInstance() const { return !isStatic(); }
bool isVirtual() const {
@@ -1398,7 +1398,7 @@
bool isExplicitSpecified, bool isInline,
bool isImplicitlyDeclared)
: CXXMethodDecl(CXXConstructor, RD, NameInfo, T, TInfo, false,
- FunctionDecl::None, isInline),
+ SC_None, isInline),
IsExplicitSpecified(isExplicitSpecified), ImplicitlyDefined(false),
BaseOrMemberInitializers(0), NumBaseOrMemberInitializers(0) {
setImplicit(isImplicitlyDeclared);
@@ -1544,7 +1544,7 @@
CXXDestructorDecl(CXXRecordDecl *RD, const DeclarationNameInfo &NameInfo,
QualType T, bool isInline, bool isImplicitlyDeclared)
: CXXMethodDecl(CXXDestructor, RD, NameInfo, T, /*TInfo=*/0, false,
- FunctionDecl::None, isInline),
+ SC_None, isInline),
ImplicitlyDefined(false), OperatorDelete(0) {
setImplicit(isImplicitlyDeclared);
}
@@ -1605,7 +1605,7 @@
QualType T, TypeSourceInfo *TInfo,
bool isInline, bool isExplicitSpecified)
: CXXMethodDecl(CXXConversion, RD, NameInfo, T, TInfo, false,
- FunctionDecl::None, isInline),
+ SC_None, isInline),
IsExplicitSpecified(isExplicitSpecified) { }
public:
Modified: cfe/trunk/include/clang/AST/DeclTemplate.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclTemplate.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/DeclTemplate.h (original)
+++ cfe/trunk/include/clang/AST/DeclTemplate.h Wed Aug 25 22:08:43 2010
@@ -1016,8 +1016,7 @@
NonTypeTemplateParmDecl(DeclContext *DC, SourceLocation L, unsigned D,
unsigned P, IdentifierInfo *Id, QualType T,
TypeSourceInfo *TInfo)
- : VarDecl(NonTypeTemplateParm, DC, L, Id, T, TInfo, VarDecl::None,
- VarDecl::None),
+ : VarDecl(NonTypeTemplateParm, DC, L, Id, T, TInfo, SC_None, SC_None),
TemplateParmPosition(D, P), DefaultArgumentAndInherited(0, false)
{ }
Modified: cfe/trunk/include/clang/Basic/Specifiers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Specifiers.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Specifiers.h (original)
+++ cfe/trunk/include/clang/Basic/Specifiers.h Wed Aug 25 22:08:43 2010
@@ -95,6 +95,51 @@
VK_XValue
};
+ // \brief Describes the kind of template specialization that a
+ // particular template specialization declaration represents.
+ enum TemplateSpecializationKind {
+ /// This template specialization was formed from a template-id but
+ /// has not yet been declared, defined, or instantiated.
+ TSK_Undeclared = 0,
+ /// This template specialization was implicitly instantiated from a
+ /// template. (C++ [temp.inst]).
+ TSK_ImplicitInstantiation,
+ /// This template specialization was declared or defined by an
+ /// explicit specialization (C++ [temp.expl.spec]) or partial
+ /// specialization (C++ [temp.class.spec]).
+ TSK_ExplicitSpecialization,
+ /// This template specialization was instantiated from a template
+ /// due to an explicit instantiation declaration request
+ /// (C++0x [temp.explicit]).
+ TSK_ExplicitInstantiationDeclaration,
+ /// This template specialization was instantiated from a template
+ /// due to an explicit instantiation definition request
+ /// (C++ [temp.explicit]).
+ TSK_ExplicitInstantiationDefinition
+ };
+
+ /// \brief Storage classes.
+ enum StorageClass {
+ // These are legal on both functions and variables.
+ SC_None,
+ SC_Extern,
+ SC_Static,
+ SC_PrivateExtern,
+
+ // These are only legal on variables.
+ SC_Auto,
+ SC_Register
+ };
+
+ /// Checks whether the given storage class is legal for functions.
+ inline bool isLegalForFunction(StorageClass SC) {
+ return SC <= SC_PrivateExtern;
+ }
+
+ /// Checks whether the given storage class is legal for variables.
+ inline bool isLegalForVariable(StorageClass SC) {
+ return true;
+ }
} // end namespace clang
#endif // LLVM_CLANG_BASIC_SPECIFIERS_H
Modified: cfe/trunk/include/clang/Frontend/DeclXML.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/DeclXML.def?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/DeclXML.def (original)
+++ cfe/trunk/include/clang/Frontend/DeclXML.def Wed Aug 25 22:08:43 2010
@@ -95,10 +95,10 @@
TYPE_ATTRIBUTE_XML(getType()->getAs<FunctionType>()->getResultType())
ATTRIBUTE_XML(getType()->getAs<FunctionType>(), "function_type")
ATTRIBUTE_ENUM_OPT_XML(getStorageClass(), "storage_class")
- ENUM_XML(FunctionDecl::None, "")
- ENUM_XML(FunctionDecl::Extern, "extern")
- ENUM_XML(FunctionDecl::Static, "static")
- ENUM_XML(FunctionDecl::PrivateExtern, "__private_extern__")
+ ENUM_XML(SC_None, "")
+ ENUM_XML(SC_Extern, "extern")
+ ENUM_XML(SC_Static, "static")
+ ENUM_XML(SC_PrivateExtern, "__private_extern__")
END_ENUM_XML
ATTRIBUTE_OPT_XML(isInlineSpecified(), "inline")
//ATTRIBUTE_OPT_XML(isVariadic(), "variadic") // in the type reference
@@ -289,12 +289,12 @@
ATTRIBUTE_XML(getNameAsString(), "name")
TYPE_ATTRIBUTE_XML(getType())
ATTRIBUTE_ENUM_OPT_XML(getStorageClass(), "storage_class")
- ENUM_XML(VarDecl::None, "")
- ENUM_XML(VarDecl::Auto, "auto")
- ENUM_XML(VarDecl::Register, "register")
- ENUM_XML(VarDecl::Extern, "extern")
- ENUM_XML(VarDecl::Static, "static")
- ENUM_XML(VarDecl::PrivateExtern, "__private_extern__")
+ ENUM_XML(SC_None, "")
+ ENUM_XML(SC_Auto, "auto")
+ ENUM_XML(SC_Register, "register")
+ ENUM_XML(SC_Extern, "extern")
+ ENUM_XML(SC_Static, "static")
+ ENUM_XML(SC_PrivateExtern, "__private_extern__")
END_ENUM_XML
SUB_NODE_OPT_XML(Expr) // init expr
END_NODE_XML
Modified: cfe/trunk/include/clang/Sema/DelayedDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/DelayedDiagnostic.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/DelayedDiagnostic.h (original)
+++ cfe/trunk/include/clang/Sema/DelayedDiagnostic.h Wed Aug 25 22:08:43 2010
@@ -56,7 +56,7 @@
CXXRecordDecl *DerivedClass,
AccessSpecifier Access)
: Access(Access), IsMember(false),
- Target(reinterpret_cast<NamedDecl*>(BaseClass)),
+ Target(BaseClass),
NamingClass(DerivedClass),
Diag(0, Context.getDiagAllocator()) {
}
@@ -71,7 +71,7 @@
// ...and these apply to hierarchy conversions.
CXXRecordDecl *getBaseClass() const {
- assert(!IsMember); return reinterpret_cast<CXXRecordDecl*>(Target);
+ assert(!IsMember); return cast<CXXRecordDecl>(Target);
}
CXXRecordDecl *getDerivedClass() const { return NamingClass; }
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Aug 25 22:08:43 2010
@@ -20,9 +20,9 @@
#include "clang/Sema/IdentifierResolver.h"
#include "clang/Sema/ObjCMethodList.h"
#include "clang/AST/OperationKinds.h"
-#include "clang/AST/Decl.h"
-#include "clang/AST/Expr.h"
+#include "clang/AST/DeclBase.h"
#include "clang/AST/DeclarationName.h"
+#include "clang/AST/ExternalASTSource.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
@@ -40,6 +40,7 @@
class ASTConsumer;
class ASTContext;
class ArrayType;
+ class BlockDecl;
class CXXBasePath;
class CXXBasePaths;
typedef llvm::SmallVector<CXXBaseSpecifier*, 4> CXXCastPath;
@@ -62,8 +63,10 @@
class DeclContext;
class DeclRefExpr;
class DeclSpec;
+ class DeclaratorDecl;
class DeducedTemplateArgument;
class DesignatedInitExpr;
+ class EnumConstantDecl;
class Expr;
class ExtVectorType;
class ExternalSemaSource;
@@ -71,6 +74,7 @@
class FullExpr;
class FunctionDecl;
class FunctionProtoType;
+ class FunctionTemplateDecl;
class ImplicitConversionSequence;
class InitListExpr;
class InitializationKind;
@@ -116,12 +120,13 @@
class TemplateTemplateParmDecl;
class Token;
class TypedefDecl;
- class TypedefDecl;
class UnresolvedLookupExpr;
class UnresolvedMemberExpr;
+ class UnresolvedSetImpl;
class UnresolvedSetIterator;
class UsingDecl;
class UsingShadowDecl;
+ class ValueDecl;
class VarDecl;
class VisibleDeclConsumer;
@@ -652,8 +657,8 @@
TypeSourceInfo *TSInfo, QualType T,
IdentifierInfo *Name,
SourceLocation NameLoc,
- VarDecl::StorageClass StorageClass,
- VarDecl::StorageClass StorageClassAsWritten);
+ StorageClass SC,
+ StorageClass SCAsWritten);
virtual void ActOnParamDefaultArgument(Decl *param,
SourceLocation EqualLoc,
ExprArg defarg);
@@ -2487,13 +2492,13 @@
MultiTemplateParamsArg TemplateParams);
QualType CheckConstructorDeclarator(Declarator &D, QualType R,
- FunctionDecl::StorageClass& SC);
+ StorageClass& SC);
void CheckConstructor(CXXConstructorDecl *Constructor);
QualType CheckDestructorDeclarator(Declarator &D, QualType R,
- FunctionDecl::StorageClass& SC);
+ StorageClass& SC);
bool CheckDestructor(CXXDestructorDecl *Destructor);
void CheckConversionDeclarator(Declarator &D, QualType &R,
- FunctionDecl::StorageClass& SC);
+ StorageClass& SC);
Decl *ActOnConversionDeclarator(CXXConversionDecl *Conversion);
//===--------------------------------------------------------------------===//
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Wed Aug 25 22:08:43 2010
@@ -116,7 +116,7 @@
// (This bullet corresponds to C99 6.2.2p3.)
if (const VarDecl *Var = dyn_cast<VarDecl>(D)) {
// Explicitly declared static.
- if (Var->getStorageClass() == VarDecl::Static)
+ if (Var->getStorageClass() == SC_Static)
return InternalLinkage;
// - an object or reference that is explicitly declared const
@@ -125,8 +125,8 @@
// (there is no equivalent in C99)
if (Context.getLangOptions().CPlusPlus &&
Var->getType().isConstant(Context) &&
- Var->getStorageClass() != VarDecl::Extern &&
- Var->getStorageClass() != VarDecl::PrivateExtern) {
+ Var->getStorageClass() != SC_Extern &&
+ Var->getStorageClass() != SC_PrivateExtern) {
bool FoundExtern = false;
for (const VarDecl *PrevVar = Var->getPreviousDeclaration();
PrevVar && !FoundExtern;
@@ -149,7 +149,7 @@
Function = cast<FunctionDecl>(D);
// Explicitly declared static.
- if (Function->getStorageClass() == FunctionDecl::Static)
+ if (Function->getStorageClass() == SC_Static)
return InternalLinkage;
} else if (const FieldDecl *Field = dyn_cast<FieldDecl>(D)) {
// - a data member of an anonymous union.
@@ -165,8 +165,8 @@
// - an object or reference, unless it has internal linkage; or
if (const VarDecl *Var = dyn_cast<VarDecl>(D)) {
if (!Context.getLangOptions().CPlusPlus &&
- (Var->getStorageClass() == VarDecl::Extern ||
- Var->getStorageClass() == VarDecl::PrivateExtern)) {
+ (Var->getStorageClass() == SC_Extern ||
+ Var->getStorageClass() == SC_PrivateExtern)) {
// C99 6.2.2p4:
// For an identifier declared with the storage-class specifier
// extern in a scope in which a prior declaration of that
@@ -200,9 +200,9 @@
// as if it were declared with the storage-class specifier
// extern.
if (!Context.getLangOptions().CPlusPlus &&
- (Function->getStorageClass() == FunctionDecl::Extern ||
- Function->getStorageClass() == FunctionDecl::PrivateExtern ||
- Function->getStorageClass() == FunctionDecl::None)) {
+ (Function->getStorageClass() == SC_Extern ||
+ Function->getStorageClass() == SC_PrivateExtern ||
+ Function->getStorageClass() == SC_None)) {
// C99 6.2.2p4:
// For an identifier declared with the storage-class specifier
// extern in a scope in which a prior declaration of that
@@ -383,8 +383,8 @@
}
if (const VarDecl *Var = dyn_cast<VarDecl>(this))
- if (Var->getStorageClass() == VarDecl::Extern ||
- Var->getStorageClass() == VarDecl::PrivateExtern) {
+ if (Var->getStorageClass() == SC_Extern ||
+ Var->getStorageClass() == SC_PrivateExtern) {
if (Var->getPreviousDeclaration())
if (Linkage L = Var->getPreviousDeclaration()->getLinkage())
return L;
@@ -637,12 +637,12 @@
const char *VarDecl::getStorageClassSpecifierString(StorageClass SC) {
switch (SC) {
- case VarDecl::None: break;
- case VarDecl::Auto: return "auto"; break;
- case VarDecl::Extern: return "extern"; break;
- case VarDecl::PrivateExtern: return "__private_extern__"; break;
- case VarDecl::Register: return "register"; break;
- case VarDecl::Static: return "static"; break;
+ case SC_None: break;
+ case SC_Auto: return "auto"; break;
+ case SC_Extern: return "extern"; break;
+ case SC_PrivateExtern: return "__private_extern__"; break;
+ case SC_Register: return "register"; break;
+ case SC_Static: return "static"; break;
}
assert(0 && "Invalid storage class");
@@ -672,14 +672,14 @@
ASTContext &Context = getASTContext();
if (!Context.getLangOptions().CPlusPlus)
return (getDeclContext()->isTranslationUnit() &&
- getStorageClass() != Static) ||
+ getStorageClass() != SC_Static) ||
(getDeclContext()->isFunctionOrMethod() && hasExternalStorage());
for (const DeclContext *DC = getDeclContext(); !DC->isTranslationUnit();
DC = DC->getParent()) {
if (const LinkageSpecDecl *Linkage = dyn_cast<LinkageSpecDecl>(DC)) {
if (Linkage->getLanguage() == LinkageSpecDecl::lang_c)
- return getStorageClass() != Static;
+ return getStorageClass() != SC_Static;
break;
}
@@ -724,8 +724,8 @@
if (hasExternalStorage())
return DeclarationOnly;
- if (getStorageClassAsWritten() == Extern ||
- getStorageClassAsWritten() == PrivateExtern) {
+ if (getStorageClassAsWritten() == SC_Extern ||
+ getStorageClassAsWritten() == SC_PrivateExtern) {
for (const VarDecl *PrevVar = getPreviousDeclaration();
PrevVar; PrevVar = PrevVar->getPreviousDeclaration()) {
if (PrevVar->getLinkage() == InternalLinkage && PrevVar->hasInit())
@@ -978,13 +978,13 @@
// In C, any non-static, non-overloadable function has external
// linkage.
if (!Context.getLangOptions().CPlusPlus)
- return getStorageClass() != Static && !getAttr<OverloadableAttr>();
+ return getStorageClass() != SC_Static && !getAttr<OverloadableAttr>();
for (const DeclContext *DC = getDeclContext(); !DC->isTranslationUnit();
DC = DC->getParent()) {
if (const LinkageSpecDecl *Linkage = dyn_cast<LinkageSpecDecl>(DC)) {
if (Linkage->getLanguage() == LinkageSpecDecl::lang_c)
- return getStorageClass() != Static &&
+ return getStorageClass() != SC_Static &&
!getAttr<OverloadableAttr>();
break;
@@ -1001,7 +1001,7 @@
if (const CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(this))
return Method->isStatic();
- if (getStorageClass() == Static)
+ if (getStorageClass() == SC_Static)
return false;
for (const DeclContext *DC = getDeclContext();
@@ -1060,7 +1060,7 @@
// function or whether it just has the same name.
// If this is a static function, it's not a builtin.
- if (getStorageClass() == Static)
+ if (getStorageClass() == SC_Static)
return 0;
// If this function is at translation-unit scope and we're not in
@@ -1194,7 +1194,7 @@
for (redecl_iterator Redecl = redecls_begin(), RedeclEnd = redecls_end();
Redecl != RedeclEnd;
++Redecl) {
- if (Redecl->isInlineSpecified() && Redecl->getStorageClass() != Extern)
+ if (Redecl->isInlineSpecified() && Redecl->getStorageClass() != SC_Extern)
return true;
}
@@ -1213,7 +1213,7 @@
if (!Redecl->getLexicalDeclContext()->isTranslationUnit())
continue;
- if (!Redecl->isInlineSpecified() || Redecl->getStorageClass() == Extern)
+ if (!Redecl->isInlineSpecified() || Redecl->getStorageClass() == SC_Extern)
return true; // Not an inline definition
}
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Wed Aug 25 22:08:43 2010
@@ -335,10 +335,11 @@
void DeclPrinter::VisitFunctionDecl(FunctionDecl *D) {
if (!Policy.SuppressSpecifiers) {
switch (D->getStorageClass()) {
- case FunctionDecl::None: break;
- case FunctionDecl::Extern: Out << "extern "; break;
- case FunctionDecl::Static: Out << "static "; break;
- case FunctionDecl::PrivateExtern: Out << "__private_extern__ "; break;
+ case SC_None: break;
+ case SC_Extern: Out << "extern "; break;
+ case SC_Static: Out << "static "; break;
+ case SC_PrivateExtern: Out << "__private_extern__ "; break;
+ case SC_Auto: case SC_Register: llvm_unreachable("invalid for functions");
}
if (D->isInlineSpecified()) Out << "inline ";
@@ -505,7 +506,7 @@
}
void DeclPrinter::VisitVarDecl(VarDecl *D) {
- if (!Policy.SuppressSpecifiers && D->getStorageClass() != VarDecl::None)
+ if (!Policy.SuppressSpecifiers && D->getStorageClass() != SC_None)
Out << VarDecl::getStorageClassSpecifierString(D->getStorageClass()) << " ";
if (!Policy.SuppressSpecifiers && D->isThreadSpecified())
Modified: cfe/trunk/lib/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtDumper.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtDumper.cpp (original)
+++ cfe/trunk/lib/AST/StmtDumper.cpp Wed Aug 25 22:08:43 2010
@@ -225,7 +225,7 @@
OS << "\"";
// Emit storage class for vardecls.
if (VarDecl *V = dyn_cast<VarDecl>(VD)) {
- if (V->getStorageClass() != VarDecl::None)
+ if (V->getStorageClass() != SC_None)
OS << VarDecl::getStorageClassSpecifierString(V->getStorageClass())
<< " ";
}
Modified: cfe/trunk/lib/Checker/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BasicStore.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicStore.cpp (original)
+++ cfe/trunk/lib/Checker/BasicStore.cpp Wed Aug 25 22:08:43 2010
@@ -437,11 +437,11 @@
// will not be called more than once.
// Static global variables should not be visited here.
- assert(!(VD->getStorageClass() == VarDecl::Static &&
+ assert(!(VD->getStorageClass() == SC_Static &&
VD->isFileVarDecl()));
// Process static variables.
- if (VD->getStorageClass() == VarDecl::Static) {
+ if (VD->getStorageClass() == SC_Static) {
// C99: 6.7.8 Initialization
// If an object that has static storage duration is not initialized
// explicitly, then:
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Wed Aug 25 22:08:43 2010
@@ -722,7 +722,7 @@
++i) {
const VarDecl *VD = dyn_cast<VarDecl>(i->first);
- if (VD->getStorageClass() == VarDecl::Static || VD->hasExternalStorage())
+ if (VD->getStorageClass() == SC_Static || VD->hasExternalStorage())
LocalDeclMap[VD] = i->second;
}
@@ -803,8 +803,8 @@
getContext().getTranslationUnitDecl(),
SourceLocation(), ID, FnType,
0,
- FunctionDecl::Static,
- FunctionDecl::None,
+ SC_Static,
+ SC_None,
false, HasPrototype);
if (FunctionProtoType *FT = dyn_cast<FunctionProtoType>(FnType)) {
const FunctionDecl *CFD = dyn_cast<FunctionDecl>(CurCodeDecl);
@@ -814,7 +814,7 @@
Params.push_back(ParmVarDecl::Create(getContext(), FD,
SourceLocation(), 0,
FT->getArgType(i), /*TInfo=*/0,
- VarDecl::None, VarDecl::None, 0));
+ SC_None, SC_None, 0));
FD->setParams(Params.data(), Params.size());
}
@@ -916,7 +916,7 @@
getContext().getTranslationUnitDecl(),
SourceLocation(),
0, QualType(PadTy), 0,
- VarDecl::None, VarDecl::None);
+ SC_None, SC_None);
Expr *E = new (getContext()) DeclRefExpr(PadDecl, PadDecl->getType(),
SourceLocation());
BlockLayout.push_back(E);
@@ -962,8 +962,8 @@
FunctionDecl *FD = FunctionDecl::Create(getContext(),
getContext().getTranslationUnitDecl(),
SourceLocation(), II, R, 0,
- FunctionDecl::Static,
- FunctionDecl::None,
+ SC_Static,
+ SC_None,
false,
true);
CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
@@ -1044,8 +1044,8 @@
FunctionDecl *FD = FunctionDecl::Create(getContext(),
getContext().getTranslationUnitDecl(),
SourceLocation(), II, R, 0,
- FunctionDecl::Static,
- FunctionDecl::None,
+ SC_Static,
+ SC_None,
false, true);
CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
@@ -1129,8 +1129,8 @@
FunctionDecl *FD = FunctionDecl::Create(getContext(),
getContext().getTranslationUnitDecl(),
SourceLocation(), II, R, 0,
- FunctionDecl::Static,
- FunctionDecl::None,
+ SC_Static,
+ SC_None,
false, true);
CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
@@ -1193,8 +1193,8 @@
FunctionDecl *FD = FunctionDecl::Create(getContext(),
getContext().getTranslationUnitDecl(),
SourceLocation(), II, R, 0,
- FunctionDecl::Static,
- FunctionDecl::None,
+ SC_Static,
+ SC_None,
false, true);
CGF.StartFunction(FD, R, Fn, Args, SourceLocation());
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Wed Aug 25 22:08:43 2010
@@ -107,11 +107,11 @@
CGM.ErrorUnsupported(&D, "__asm__");
switch (D.getStorageClass()) {
- case VarDecl::None:
- case VarDecl::Auto:
- case VarDecl::Register:
+ case SC_None:
+ case SC_Auto:
+ case SC_Register:
return EmitLocalBlockVarDecl(D);
- case VarDecl::Static: {
+ case SC_Static: {
llvm::GlobalValue::LinkageTypes Linkage =
llvm::GlobalValue::InternalLinkage;
@@ -126,8 +126,8 @@
return EmitStaticBlockVarDecl(D, Linkage);
}
- case VarDecl::Extern:
- case VarDecl::PrivateExtern:
+ case SC_Extern:
+ case SC_PrivateExtern:
// Don't emit it now, allow it to be emitted lazily on its first use.
return;
}
@@ -568,7 +568,7 @@
} else {
// Targets that don't support recursion emit locals as globals.
const char *Class =
- D.getStorageClass() == VarDecl::Register ? ".reg." : ".auto.";
+ D.getStorageClass() == SC_Register ? ".reg." : ".auto.";
DeclPtr = CreateStaticBlockVarDecl(D, Class,
llvm::GlobalValue
::InternalLinkage);
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Wed Aug 25 22:08:43 2010
@@ -145,7 +145,7 @@
LangOptions::VisibilityMode
CodeGenModule::getDeclVisibilityMode(const Decl *D) const {
if (const VarDecl *VD = dyn_cast<VarDecl>(D))
- if (VD->getStorageClass() == VarDecl::PrivateExtern)
+ if (VD->getStorageClass() == SC_PrivateExtern)
return LangOptions::Hidden;
if (const VisibilityAttr *attr = D->getAttr<VisibilityAttr>()) {
@@ -965,7 +965,7 @@
GV->setConstant(DeclIsConstantGlobal(Context, D));
// FIXME: Merge with other attribute handling code.
- if (D->getStorageClass() == VarDecl::PrivateExtern)
+ if (D->getStorageClass() == SC_PrivateExtern)
GV->setVisibility(llvm::GlobalValue::HiddenVisibility);
if (D->hasAttr<WeakAttr>() ||
Modified: cfe/trunk/lib/Index/Entity.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/Entity.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Index/Entity.cpp (original)
+++ cfe/trunk/lib/Index/Entity.cpp Wed Aug 25 22:08:43 2010
@@ -134,7 +134,7 @@
return Entity();
// If it's static it cannot be referred to by another translation unit.
- if (D->getStorageClass() == VarDecl::Static)
+ if (D->getStorageClass() == SC_Static)
return Entity(D);
return VisitNamedDecl(D);
@@ -142,7 +142,7 @@
Entity EntityGetter::VisitFunctionDecl(FunctionDecl *D) {
// If it's static it cannot be refered to by another translation unit.
- if (D->getStorageClass() == FunctionDecl::Static)
+ if (D->getStorageClass() == SC_Static)
return Entity(D);
return VisitNamedDecl(D);
Modified: cfe/trunk/lib/Rewrite/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteObjC.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteObjC.cpp Wed Aug 25 22:08:43 2010
@@ -2265,8 +2265,8 @@
SelGetUidFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
SelGetUidIdent, getFuncType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
void RewriteObjC::RewriteFunctionDecl(FunctionDecl *FD) {
@@ -2364,8 +2364,8 @@
SuperContructorFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthMsgSendFunctionDecl - id objc_msgSend(id self, SEL op, ...);
@@ -2386,8 +2386,8 @@
MsgSendFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthMsgSendSuperFunctionDecl - id objc_msgSendSuper(struct objc_super *, SEL op, ...);
@@ -2411,8 +2411,8 @@
MsgSendSuperFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthMsgSendStretFunctionDecl - id objc_msgSend_stret(id self, SEL op, ...);
@@ -2433,8 +2433,8 @@
MsgSendStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthMsgSendSuperStretFunctionDecl -
@@ -2460,8 +2460,8 @@
MsgSendSuperStretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthMsgSendFpretFunctionDecl - double objc_msgSend_fpret(id self, SEL op, ...);
@@ -2482,8 +2482,8 @@
MsgSendFpretFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
msgSendIdent, msgSendType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthGetClassFunctionDecl - id objc_getClass(const char *name);
@@ -2499,8 +2499,8 @@
GetClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
getClassIdent, getClassType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
// SynthGetSuperClassFunctionDecl - Class class_getSuperclass(Class cls);
@@ -2518,8 +2518,8 @@
SourceLocation(),
getSuperClassIdent,
getClassType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None,
+ SC_Extern,
+ SC_None,
false);
}
@@ -2536,8 +2536,8 @@
GetMetaClassFunctionDecl = FunctionDecl::Create(*Context, TUDecl,
SourceLocation(),
getClassIdent, getClassType, 0,
- FunctionDecl::Extern,
- FunctionDecl::None, false);
+ SC_Extern,
+ SC_None, false);
}
Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
@@ -2571,7 +2571,7 @@
VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
&Context->Idents.get(S), strType, 0,
- VarDecl::Static, VarDecl::None);
+ SC_Static, SC_None);
DeclRefExpr *DRE = new (Context) DeclRefExpr(NewVD, strType, SourceLocation());
Expr *Unop = new (Context) UnaryOperator(DRE, UO_AddrOf,
Context->getPointerType(DRE->getType()),
@@ -3080,7 +3080,7 @@
IdentifierInfo *ID = &Context->Idents.get(Name);
VarDecl *VD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
ID, getProtocolType(), 0,
- VarDecl::Extern, VarDecl::None);
+ SC_Extern, SC_None);
DeclRefExpr *DRE = new (Context) DeclRefExpr(VD, getProtocolType(), SourceLocation());
Expr *DerefExpr = new (Context) UnaryOperator(DRE, UO_AddrOf,
Context->getPointerType(DRE->getType()),
@@ -4344,7 +4344,7 @@
RewriteBlockLiteralFunctionDecl(CurFunctionDeclToDeclareForBlock);
bool RewriteSC = (GlobalVarDecl &&
!Blocks.empty() &&
- GlobalVarDecl->getStorageClass() == VarDecl::Static &&
+ GlobalVarDecl->getStorageClass() == SC_Static &&
GlobalVarDecl->getType().getCVRQualifiers());
if (RewriteSC) {
std::string SC(" void __");
@@ -4402,7 +4402,7 @@
// Must insert any 'const/volatile/static here. Since it has been
// removed as result of rewriting of block literals.
std::string SC;
- if (GlobalVarDecl->getStorageClass() == VarDecl::Static)
+ if (GlobalVarDecl->getStorageClass() == SC_Static)
SC = "static ";
if (GlobalVarDecl->getType().isConstQualified())
SC += "const ";
@@ -5115,8 +5115,8 @@
IdentifierInfo *ID = &Context->Idents.get(name);
QualType FType = Context->getFunctionNoProtoType(Context->VoidPtrTy);
return FunctionDecl::Create(*Context, TUDecl,SourceLocation(),
- ID, FType, 0, FunctionDecl::Extern,
- FunctionDecl::None, false, false);
+ ID, FType, 0, SC_Extern,
+ SC_None, false, false);
}
Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
@@ -5197,7 +5197,7 @@
VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
&Context->Idents.get(DescData.c_str()),
Context->VoidPtrTy, 0,
- VarDecl::Static, VarDecl::None);
+ SC_Static, SC_None);
UnaryOperator *DescRefExpr = new (Context) UnaryOperator(
new (Context) DeclRefExpr(NewVD,
Context->VoidPtrTy, SourceLocation()),
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Aug 25 22:08:43 2010
@@ -578,7 +578,7 @@
return false;
} else {
// 'static inline' functions are used in headers; don't warn.
- if (FD->getStorageClass() == FunctionDecl::Static &&
+ if (FD->getStorageClass() == SC_Static &&
FD->isInlineSpecified())
return false;
}
@@ -835,8 +835,8 @@
FunctionDecl *New = FunctionDecl::Create(Context,
Context.getTranslationUnitDecl(),
Loc, II, R, /*TInfo=*/0,
- FunctionDecl::Extern,
- FunctionDecl::None, false,
+ SC_Extern,
+ SC_None, false,
/*hasPrototype=*/true);
New->setImplicit();
@@ -847,7 +847,7 @@
for (unsigned i = 0, e = FT->getNumArgs(); i != e; ++i)
Params.push_back(ParmVarDecl::Create(Context, New, SourceLocation(), 0,
FT->getArgType(i), /*TInfo=*/0,
- VarDecl::None, VarDecl::None, 0));
+ SC_None, SC_None, 0));
New->setParams(Params.data(), Params.size());
}
@@ -1080,7 +1080,7 @@
const LangOptions& LangOpts) {
return (LangOpts.GNUMode && !LangOpts.C99 && !LangOpts.CPlusPlus &&
FD->isInlineSpecified() &&
- FD->getStorageClass() == FunctionDecl::Extern);
+ FD->getStorageClass() == SC_Extern);
}
/// MergeFunctionDecl - We just parsed a function 'New' from
@@ -1134,8 +1134,8 @@
// Don't complain about this if we're in GNU89 mode and the old function
// is an extern inline function.
if (!isa<CXXMethodDecl>(New) && !isa<CXXMethodDecl>(Old) &&
- New->getStorageClass() == FunctionDecl::Static &&
- Old->getStorageClass() != FunctionDecl::Static &&
+ New->getStorageClass() == SC_Static &&
+ Old->getStorageClass() != SC_Static &&
!canRedefineFunction(Old, getLangOptions())) {
Diag(New->getLocation(), diag::err_static_non_static)
<< New;
@@ -1316,7 +1316,7 @@
ParmVarDecl *Param = ParmVarDecl::Create(Context, New,
SourceLocation(), 0,
*ParamType, /*TInfo=*/0,
- VarDecl::None, VarDecl::None,
+ SC_None, SC_None,
0);
Param->setImplicit();
Params.push_back(Param);
@@ -1434,8 +1434,8 @@
MergeDeclAttributes(New, Old, Context);
// Merge the storage class.
- if (Old->getStorageClass() != FunctionDecl::Extern &&
- Old->getStorageClass() != FunctionDecl::None)
+ if (Old->getStorageClass() != SC_Extern &&
+ Old->getStorageClass() != SC_None)
New->setStorageClass(Old->getStorageClass());
// Merge "pure" flag.
@@ -1520,8 +1520,8 @@
New->setType(MergedT);
// C99 6.2.2p4: Check if we have a static decl followed by a non-static.
- if (New->getStorageClass() == VarDecl::Static &&
- (Old->getStorageClass() == VarDecl::None || Old->hasExternalStorage())) {
+ if (New->getStorageClass() == SC_Static &&
+ (Old->getStorageClass() == SC_None || Old->hasExternalStorage())) {
Diag(New->getLocation(), diag::err_static_non_static) << New->getDeclName();
Diag(Old->getLocation(), diag::note_previous_definition);
return New->setInvalidDecl();
@@ -1537,8 +1537,8 @@
// identifier has external linkage.
if (New->hasExternalStorage() && Old->hasLinkage())
/* Okay */;
- else if (New->getStorageClass() != VarDecl::Static &&
- Old->getStorageClass() == VarDecl::Static) {
+ else if (New->getStorageClass() != SC_Static &&
+ Old->getStorageClass() == SC_Static) {
Diag(New->getLocation(), diag::err_non_static_static) << New->getDeclName();
Diag(Old->getLocation(), diag::note_previous_definition);
return New->setInvalidDecl();
@@ -1780,38 +1780,38 @@
/// StorageClassSpecToVarDeclStorageClass - Maps a DeclSpec::SCS to
/// a VarDecl::StorageClass. Any error reporting is up to the caller:
-/// illegal input values are mapped to VarDecl::None.
-static VarDecl::StorageClass
+/// illegal input values are mapped to SC_None.
+static StorageClass
StorageClassSpecToVarDeclStorageClass(DeclSpec::SCS StorageClassSpec) {
switch (StorageClassSpec) {
- case DeclSpec::SCS_unspecified: return VarDecl::None;
- case DeclSpec::SCS_extern: return VarDecl::Extern;
- case DeclSpec::SCS_static: return VarDecl::Static;
- case DeclSpec::SCS_auto: return VarDecl::Auto;
- case DeclSpec::SCS_register: return VarDecl::Register;
- case DeclSpec::SCS_private_extern: return VarDecl::PrivateExtern;
+ case DeclSpec::SCS_unspecified: return SC_None;
+ case DeclSpec::SCS_extern: return SC_Extern;
+ case DeclSpec::SCS_static: return SC_Static;
+ case DeclSpec::SCS_auto: return SC_Auto;
+ case DeclSpec::SCS_register: return SC_Register;
+ case DeclSpec::SCS_private_extern: return SC_PrivateExtern;
// Illegal SCSs map to None: error reporting is up to the caller.
case DeclSpec::SCS_mutable: // Fall through.
- case DeclSpec::SCS_typedef: return VarDecl::None;
+ case DeclSpec::SCS_typedef: return SC_None;
}
llvm_unreachable("unknown storage class specifier");
}
/// StorageClassSpecToFunctionDeclStorageClass - Maps a DeclSpec::SCS to
-/// a FunctionDecl::StorageClass. Any error reporting is up to the caller:
-/// illegal input values are mapped to FunctionDecl::None.
-static FunctionDecl::StorageClass
+/// a StorageClass. Any error reporting is up to the caller:
+/// illegal input values are mapped to SC_None.
+static StorageClass
StorageClassSpecToFunctionDeclStorageClass(DeclSpec::SCS StorageClassSpec) {
switch (StorageClassSpec) {
- case DeclSpec::SCS_unspecified: return FunctionDecl::None;
- case DeclSpec::SCS_extern: return FunctionDecl::Extern;
- case DeclSpec::SCS_static: return FunctionDecl::Static;
- case DeclSpec::SCS_private_extern: return FunctionDecl::PrivateExtern;
+ case DeclSpec::SCS_unspecified: return SC_None;
+ case DeclSpec::SCS_extern: return SC_Extern;
+ case DeclSpec::SCS_static: return SC_Static;
+ case DeclSpec::SCS_private_extern: return SC_PrivateExtern;
// Illegal SCSs map to None: error reporting is up to the caller.
case DeclSpec::SCS_auto: // Fall through.
case DeclSpec::SCS_mutable: // Fall through.
case DeclSpec::SCS_register: // Fall through.
- case DeclSpec::SCS_typedef: return FunctionDecl::None;
+ case DeclSpec::SCS_typedef: return SC_None;
}
llvm_unreachable("unknown storage class specifier");
}
@@ -1954,7 +1954,7 @@
// an error here
Diag(Record->getLocation(), diag::err_mutable_nonmember);
Invalid = true;
- SC = VarDecl::None;
+ SC = SC_None;
}
SCSpec = DS.getStorageClassSpecAsWritten();
VarDecl::StorageClass SCAsWritten
@@ -2688,7 +2688,7 @@
// an error here
Diag(D.getIdentifierLoc(), diag::err_mutable_nonmember);
D.setInvalidType();
- SC = VarDecl::None;
+ SC = SC_None;
}
SCSpec = D.getDeclSpec().getStorageClassSpecAsWritten();
VarDecl::StorageClass SCAsWritten
@@ -2706,11 +2706,11 @@
if (!DC->isRecord() && S->getFnParent() == 0) {
// C99 6.9p2: The storage-class specifiers auto and register shall not
// appear in the declaration specifiers in an external declaration.
- if (SC == VarDecl::Auto || SC == VarDecl::Register) {
+ if (SC == SC_Auto || SC == SC_Register) {
// If this is a register variable with an asm label specified, then this
// is a GNU extension.
- if (SC == VarDecl::Register && D.getAsmLabel())
+ if (SC == SC_Register && D.getAsmLabel())
Diag(D.getIdentifierLoc(), diag::err_unsupported_global_register);
else
Diag(D.getIdentifierLoc(), diag::err_typecheck_sclass_fscope);
@@ -2719,14 +2719,14 @@
}
if (DC->isRecord() && !CurContext->isRecord()) {
// This is an out-of-line definition of a static data member.
- if (SC == VarDecl::Static) {
+ if (SC == SC_Static) {
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
diag::err_static_out_of_line)
<< FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
- } else if (SC == VarDecl::None)
- SC = VarDecl::Static;
+ } else if (SC == SC_None)
+ SC = SC_Static;
}
- if (SC == VarDecl::Static) {
+ if (SC == SC_Static) {
if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(DC)) {
if (RD->isLocalClass())
Diag(D.getIdentifierLoc(),
@@ -3004,7 +3004,7 @@
if (NewVD->isFileVarDecl())
Diag(NewVD->getLocation(), diag::err_vla_decl_in_file_scope)
<< SizeRange;
- else if (NewVD->getStorageClass() == VarDecl::Static)
+ else if (NewVD->getStorageClass() == SC_Static)
Diag(NewVD->getLocation(), diag::err_vla_decl_has_static_storage)
<< SizeRange;
else
@@ -3147,7 +3147,7 @@
// TODO: consider using NameInfo for diagnostic.
DeclarationNameInfo NameInfo = GetNameForDeclarator(D);
DeclarationName Name = NameInfo.getName();
- FunctionDecl::StorageClass SC = FunctionDecl::None;
+ FunctionDecl::StorageClass SC = SC_None;
switch (D.getDeclSpec().getStorageClassSpec()) {
default: assert(0 && "Unknown storage class!");
case DeclSpec::SCS_auto:
@@ -3157,8 +3157,8 @@
diag::err_typecheck_sclass_func);
D.setInvalidType();
break;
- case DeclSpec::SCS_unspecified: SC = FunctionDecl::None; break;
- case DeclSpec::SCS_extern: SC = FunctionDecl::Extern; break;
+ case DeclSpec::SCS_unspecified: SC = SC_None; break;
+ case DeclSpec::SCS_extern: SC = SC_Extern; break;
case DeclSpec::SCS_static: {
if (CurContext->getLookupContext()->isFunctionOrMethod()) {
// C99 6.7.1p5:
@@ -3168,12 +3168,12 @@
// See also (C++ [dcl.stc]p4).
Diag(D.getDeclSpec().getStorageClassSpecLoc(),
diag::err_static_block_func);
- SC = FunctionDecl::None;
+ SC = SC_None;
} else
- SC = FunctionDecl::Static;
+ SC = SC_Static;
break;
}
- case DeclSpec::SCS_private_extern: SC = FunctionDecl::PrivateExtern;break;
+ case DeclSpec::SCS_private_extern: SC = SC_PrivateExtern;break;
}
if (D.getDeclSpec().isThreadSpecified())
@@ -3279,7 +3279,7 @@
return 0;
}
- bool isStatic = SC == FunctionDecl::Static;
+ bool isStatic = SC == SC_Static;
// [class.free]p1:
// Any allocation function for a class T is a static member
@@ -3468,7 +3468,7 @@
NewFD->setAccess(AS_public);
}
- if (SC == FunctionDecl::Static && isa<CXXMethodDecl>(NewFD) &&
+ if (SC == SC_Static && isa<CXXMethodDecl>(NewFD) &&
!CurContext->isRecord()) {
// C++ [class.static]p1:
// A data or function member of a class may be declared static
@@ -3963,7 +3963,7 @@
// shall not appear in a declaration of main.
// static main is not an error under C99, but we should warn about it.
bool isInline = FD->isInlineSpecified();
- bool isStatic = FD->getStorageClass() == FunctionDecl::Static;
+ bool isStatic = FD->getStorageClass() == SC_Static;
if (isInline || isStatic) {
unsigned diagID = diag::warn_unusual_main_decl;
if (isInline || getLangOptions().CPlusPlus)
@@ -4190,7 +4190,7 @@
// C++ 3.6.2p2, allow dynamic initialization of static initializers.
// Don't check invalid declarations to avoid emitting useless diagnostics.
if (!getLangOptions().CPlusPlus && !VDecl->isInvalidDecl()) {
- if (VDecl->getStorageClass() == VarDecl::Static) // C99 6.7.8p4.
+ if (VDecl->getStorageClass() == SC_Static) // C99 6.7.8p4.
CheckForConstantInitializer(Init, DclT);
}
}
@@ -4242,7 +4242,7 @@
}
}
} else if (VDecl->isFileVarDecl()) {
- if (VDecl->getStorageClass() == VarDecl::Extern &&
+ if (VDecl->getStorageClass() == SC_Extern &&
(!getLangOptions().CPlusPlus ||
!Context.getBaseElementType(VDecl->getType()).isConstQualified()))
Diag(VDecl->getLocation(), diag::warn_extern_init);
@@ -4394,7 +4394,7 @@
ArrayT->getElementType(),
diag::err_illegal_decl_array_incomplete_type))
Var->setInvalidDecl();
- } else if (Var->getStorageClass() == VarDecl::Static) {
+ } else if (Var->getStorageClass() == SC_Static) {
// C99 6.9.2p3: If the declaration of an identifier for an object is
// a tentative definition and has internal linkage (C99 6.2.2p3), the
// declared type shall not be an incomplete type.
@@ -4529,11 +4529,11 @@
const DeclSpec &DS = D.getDeclSpec();
// Verify C99 6.7.5.3p2: The only SCS allowed is 'register'.
- VarDecl::StorageClass StorageClass = VarDecl::None;
- VarDecl::StorageClass StorageClassAsWritten = VarDecl::None;
+ VarDecl::StorageClass StorageClass = SC_None;
+ VarDecl::StorageClass StorageClassAsWritten = SC_None;
if (DS.getStorageClassSpec() == DeclSpec::SCS_register) {
- StorageClass = VarDecl::Register;
- StorageClassAsWritten = VarDecl::Register;
+ StorageClass = SC_Register;
+ StorageClassAsWritten = SC_Register;
} else if (DS.getStorageClassSpec() != DeclSpec::SCS_unspecified) {
Diag(DS.getStorageClassSpecLoc(),
diag::err_invalid_storage_class_in_func_decl);
@@ -4624,7 +4624,7 @@
QualType T) {
ParmVarDecl *Param = ParmVarDecl::Create(Context, DC, Loc, 0,
T, Context.getTrivialTypeSourceInfo(T, Loc),
- VarDecl::None, VarDecl::None, 0);
+ SC_None, SC_None, 0);
Param->setImplicit();
return Param;
}
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Aug 25 22:08:43 2010
@@ -534,9 +534,9 @@
static bool isStaticVarOrStaticFunciton(Decl *D) {
if (VarDecl *VD = dyn_cast<VarDecl>(D))
- return VD->getStorageClass() == VarDecl::Static;
+ return VD->getStorageClass() == SC_Static;
if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
- return FD->getStorageClass() == FunctionDecl::Static;
+ return FD->getStorageClass() == SC_Static;
return false;
}
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Aug 25 22:08:43 2010
@@ -1632,7 +1632,7 @@
= VarDecl::Create(SemaRef.Context, SemaRef.CurContext, Loc,
IterationVarName, SizeType,
SemaRef.Context.getTrivialTypeSourceInfo(SizeType, Loc),
- VarDecl::None, VarDecl::None);
+ SC_None, SC_None);
IndexVariables.push_back(IterationVar);
// Create a reference to the iteration variable.
@@ -2895,7 +2895,7 @@
/// will be updated to reflect a well-formed type for the constructor and
/// returned.
QualType Sema::CheckConstructorDeclarator(Declarator &D, QualType R,
- FunctionDecl::StorageClass &SC) {
+ StorageClass &SC) {
bool isVirtual = D.getDeclSpec().isVirtualSpecified();
// C++ [class.ctor]p3:
@@ -2910,13 +2910,13 @@
<< SourceRange(D.getIdentifierLoc());
D.setInvalidType();
}
- if (SC == FunctionDecl::Static) {
+ if (SC == SC_Static) {
if (!D.isInvalidType())
Diag(D.getIdentifierLoc(), diag::err_constructor_cannot_be)
<< "static" << SourceRange(D.getDeclSpec().getStorageClassSpecLoc())
<< SourceRange(D.getIdentifierLoc());
D.setInvalidType();
- SC = FunctionDecl::None;
+ SC = SC_None;
}
DeclaratorChunk::FunctionTypeInfo &FTI = D.getTypeObject(0).Fun;
@@ -3033,7 +3033,7 @@
/// will be updated to reflect a well-formed type for the destructor and
/// returned.
QualType Sema::CheckDestructorDeclarator(Declarator &D, QualType R,
- FunctionDecl::StorageClass& SC) {
+ StorageClass& SC) {
// C++ [class.dtor]p1:
// [...] A typedef-name that names a class is a class-name
// (7.1.3); however, a typedef-name that names a class shall not
@@ -3052,14 +3052,14 @@
// destructor can be invoked for a const, volatile or const
// volatile object. A destructor shall not be declared const,
// volatile or const volatile (9.3.2).
- if (SC == FunctionDecl::Static) {
+ if (SC == SC_Static) {
if (!D.isInvalidType())
Diag(D.getIdentifierLoc(), diag::err_destructor_cannot_be)
<< "static" << SourceRange(D.getDeclSpec().getStorageClassSpecLoc())
<< SourceRange(D.getIdentifierLoc())
<< FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc());
- SC = FunctionDecl::None;
+ SC = SC_None;
}
if (D.getDeclSpec().hasTypeSpecifier() && !D.isInvalidType()) {
// Destructors don't have return types, but the parser will
@@ -3127,18 +3127,18 @@
/// false. Either way, the type @p R will be updated to reflect a
/// well-formed type for the conversion operator.
void Sema::CheckConversionDeclarator(Declarator &D, QualType &R,
- FunctionDecl::StorageClass& SC) {
+ StorageClass& SC) {
// C++ [class.conv.fct]p1:
// Neither parameter types nor return type can be specified. The
// type of a conversion function (8.3.5) is "function taking no
// parameter returning conversion-type-id."
- if (SC == FunctionDecl::Static) {
+ if (SC == SC_Static) {
if (!D.isInvalidType())
Diag(D.getIdentifierLoc(), diag::err_conv_function_not_member)
<< "static" << SourceRange(D.getDeclSpec().getStorageClassSpecLoc())
<< SourceRange(D.getIdentifierLoc());
D.setInvalidType();
- SC = FunctionDecl::None;
+ SC = SC_None;
}
QualType ConvType = GetTypeFromParser(D.getName().ConversionFunctionId);
@@ -4664,7 +4664,7 @@
VarDecl *IterationVar = VarDecl::Create(S.Context, S.CurContext, Loc,
IterationVarName, SizeType,
S.Context.getTrivialTypeSourceInfo(SizeType, Loc),
- VarDecl::None, VarDecl::None);
+ SC_None, SC_None);
// Initialize the iteration variable to zero.
llvm::APInt Zero(S.Context.getTypeSize(SizeType), 0);
@@ -4872,7 +4872,7 @@
ExceptSpec.data(),
FunctionType::ExtInfo()),
/*TInfo=*/0, /*isStatic=*/false,
- /*StorageClassAsWritten=*/FunctionDecl::None,
+ /*StorageClassAsWritten=*/SC_None,
/*isInline=*/true);
CopyAssignment->setAccess(AS_public);
CopyAssignment->setImplicit();
@@ -4884,8 +4884,8 @@
ClassDecl->getLocation(),
/*Id=*/0,
ArgType, /*TInfo=*/0,
- VarDecl::None,
- VarDecl::None, 0);
+ SC_None,
+ SC_None, 0);
CopyAssignment->setParams(&FromParam, 1);
// Note that we have added this copy-assignment operator.
@@ -5362,8 +5362,8 @@
ClassDecl->getLocation(),
/*IdentifierInfo=*/0,
ArgType, /*TInfo=*/0,
- VarDecl::None,
- VarDecl::None, 0);
+ SC_None,
+ SC_None, 0);
CopyConstructor->setParams(&FromParam, 1);
if (Scope *S = getScopeForContext(ClassDecl))
PushOnScopeChains(CopyConstructor, S, false);
@@ -5658,7 +5658,7 @@
}
if (isa<TranslationUnitDecl>(DC) &&
- FnDecl->getStorageClass() == FunctionDecl::Static) {
+ FnDecl->getStorageClass() == SC_Static) {
return SemaRef.Diag(FnDecl->getLocation(),
diag::err_operator_new_delete_declared_static)
<< FnDecl->getDeclName();
@@ -6135,8 +6135,8 @@
}
VarDecl *ExDecl = VarDecl::Create(Context, CurContext, Loc,
- Name, ExDeclType, TInfo, VarDecl::None,
- VarDecl::None);
+ Name, ExDeclType, TInfo, SC_None,
+ SC_None);
ExDecl->setExceptionVariable(true);
if (!Invalid) {
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Aug 25 22:08:43 2010
@@ -1528,7 +1528,7 @@
ParmVarDecl* Param
= ParmVarDecl::Create(Context, ObjCMethod, ArgInfo[i].NameLoc,
ArgInfo[i].Name, ArgType, DI,
- VarDecl::None, VarDecl::None, 0);
+ SC_None, SC_None, 0);
if (ArgType->isObjCObjectType()) {
Diag(ArgInfo[i].NameLoc,
@@ -1705,7 +1705,7 @@
}
VarDecl *New = VarDecl::Create(Context, CurContext, NameLoc, Name, T, TInfo,
- VarDecl::None, VarDecl::None);
+ SC_None, SC_None);
New->setExceptionVariable(true);
if (Invalid)
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Aug 25 22:08:43 2010
@@ -6291,7 +6291,7 @@
if (const VarDecl *vd = dyn_cast<VarDecl>(dcl)) {
// in C++ it is not error to take address of a register
// variable (c++03 7.1.1P3)
- if (vd->getStorageClass() == VarDecl::Register &&
+ if (vd->getStorageClass() == SC_Register &&
!getLangOptions().CPlusPlus) {
Diag(OpLoc, diag::err_typecheck_address_of)
<< "register variable" << op->getSourceRange();
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Aug 25 22:08:43 2010
@@ -1283,8 +1283,8 @@
FunctionType::ExtInfo());
FunctionDecl *Alloc =
FunctionDecl::Create(Context, GlobalCtx, SourceLocation(), Name,
- FnType, /*TInfo=*/0, FunctionDecl::None,
- FunctionDecl::None, false, true);
+ FnType, /*TInfo=*/0, SC_None,
+ SC_None, false, true);
Alloc->setImplicit();
if (AddMallocAttr)
@@ -1292,8 +1292,8 @@
ParmVarDecl *Param = ParmVarDecl::Create(Context, Alloc, SourceLocation(),
0, Argument, /*TInfo=*/0,
- VarDecl::None,
- VarDecl::None, 0);
+ SC_None,
+ SC_None, 0);
Alloc->setParams(&Param, 1);
// FIXME: Also add this declaration to the IdentifierResolver, but
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Wed Aug 25 22:08:43 2010
@@ -1134,8 +1134,8 @@
property->getIdentifier(),
property->getType(),
/*TInfo=*/0,
- VarDecl::None,
- VarDecl::None,
+ SC_None,
+ SC_None,
0);
SetterMethod->setMethodParams(Context, &Argument, 1, 1);
CD->addDecl(SetterMethod);
Modified: cfe/trunk/lib/Serialization/ASTReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderDecl.cpp?rev=112156&r1=112155&r2=112156&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReaderDecl.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReaderDecl.cpp Wed Aug 25 22:08:43 2010
@@ -312,8 +312,8 @@
// after everything else is read.
VisitRedeclarable(FD);
- FD->setStorageClass((FunctionDecl::StorageClass)Record[Idx++]);
- FD->setStorageClassAsWritten((FunctionDecl::StorageClass)Record[Idx++]);
+ FD->setStorageClass((StorageClass)Record[Idx++]);
+ FD->setStorageClassAsWritten((StorageClass)Record[Idx++]);
FD->setInlineSpecified(Record[Idx++]);
FD->setVirtualAsWritten(Record[Idx++]);
FD->setPure(Record[Idx++]);
@@ -554,8 +554,8 @@
void ASTDeclReader::VisitVarDecl(VarDecl *VD) {
VisitDeclaratorDecl(VD);
- VD->setStorageClass((VarDecl::StorageClass)Record[Idx++]);
- VD->setStorageClassAsWritten((VarDecl::StorageClass)Record[Idx++]);
+ VD->setStorageClass((StorageClass)Record[Idx++]);
+ VD->setStorageClassAsWritten((StorageClass)Record[Idx++]);
VD->setThreadSpecified(Record[Idx++]);
VD->setCXXDirectInitializer(Record[Idx++]);
VD->setExceptionVariable(Record[Idx++]);
@@ -1368,7 +1368,7 @@
break;
case DECL_VAR:
D = VarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
- VarDecl::None, VarDecl::None);
+ SC_None, SC_None);
break;
case DECL_IMPLICIT_PARAM:
@@ -1377,7 +1377,7 @@
case DECL_PARM_VAR:
D = ParmVarDecl::Create(*Context, 0, SourceLocation(), 0, QualType(), 0,
- VarDecl::None, VarDecl::None, 0);
+ SC_None, SC_None, 0);
break;
case DECL_FILE_SCOPE_ASM:
D = FileScopeAsmDecl::Create(*Context, 0, SourceLocation(), 0);
More information about the cfe-commits
mailing list