aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-26 03:08:43 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-26 03:08:43 +0000
commitd931b086984257de68868a64a235c2b4b34003fb (patch)
treeea2c4dabfee74358db8ed074f8c728910b745c1b /lib/CodeGen
parent86d00659f729473846f1681f6c003982e77e6fdd (diff)
De-memberify the VarDecl and FunctionDecl StorageClass enums.
This lets us remove Sema.h's dependency on Expr.h and Decl.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112156 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGBlocks.cpp26
-rw-r--r--lib/CodeGen/CGDecl.cpp14
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
3 files changed, 22 insertions, 22 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 5feca9d2e0..04f1ef24b2 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/lib/CodeGen/CGBlocks.cpp
@@ -722,7 +722,7 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, const BlockExpr *BExpr,
++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 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, const BlockExpr *BExpr,
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 @@ CodeGenFunction::GenerateBlockFunction(GlobalDecl GD, const BlockExpr *BExpr,
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 @@ CharUnits BlockFunction::getBlockOffset(CharUnits Size, CharUnits Align) {
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 @@ GenerateCopyHelperFunction(bool BlockHasCopyDispose, const llvm::StructType *T,
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 @@ GenerateDestroyHelperFunction(bool BlockHasCopyDispose,
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 @@ GeneratebyrefCopyHelperFunction(const llvm::Type *T, int flag) {
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 @@ BlockFunction::GeneratebyrefDestroyHelperFunction(const llvm::Type *T,
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());
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index fa75daee86..8ce196b64e 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -107,11 +107,11 @@ void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
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 @@ void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
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 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D,
} 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);
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index e6388373ea..d8e12e7cb9 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -145,7 +145,7 @@ void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type,
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 @@ CodeGenModule::GetOrCreateLLVMGlobal(llvm::StringRef MangledName,
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>() ||