aboutsummaryrefslogtreecommitdiff
path: root/lib/Rewrite
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-04-03 15:50:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-04-03 15:50:00 +0000
commit8f187f62cb0487d31bc4afdfcd47e11fe9a51d05 (patch)
tree16079bb5d4f35987feea5b5e1ed85ed5c9c493e9 /lib/Rewrite
parent8ed9f2b25f082a1643ab5310f9eec33cf31a7577 (diff)
Don't compute a patched/semantic storage class.
For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite')
-rw-r--r--lib/Rewrite/Frontend/RewriteModernObjC.cpp34
-rw-r--r--lib/Rewrite/Frontend/RewriteObjC.cpp28
2 files changed, 31 insertions, 31 deletions
diff --git a/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/lib/Rewrite/Frontend/RewriteModernObjC.cpp
index 03fd17f3da..ffadfd3c1a 100644
--- a/lib/Rewrite/Frontend/RewriteModernObjC.cpp
+++ b/lib/Rewrite/Frontend/RewriteModernObjC.cpp
@@ -2361,7 +2361,7 @@ void RewriteModernObjC::SynthSelGetUidFunctionDecl() {
SourceLocation(),
SourceLocation(),
SelGetUidIdent, getFuncType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
void RewriteModernObjC::RewriteFunctionDecl(FunctionDecl *FD) {
@@ -2459,7 +2459,7 @@ void RewriteModernObjC::SynthSuperContructorFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType,
- 0, SC_Extern, SC_None);
+ 0, SC_Extern);
}
// SynthMsgSendFunctionDecl - id objc_msgSend(id self, SEL op, ...);
@@ -2478,7 +2478,7 @@ void RewriteModernObjC::SynthMsgSendFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendSuperFunctionDecl - id objc_msgSendSuper(void);
@@ -2492,7 +2492,7 @@ void RewriteModernObjC::SynthMsgSendSuperFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendStretFunctionDecl - id objc_msgSend_stret(id self, SEL op, ...);
@@ -2511,7 +2511,7 @@ void RewriteModernObjC::SynthMsgSendStretFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendSuperStretFunctionDecl -
@@ -2528,7 +2528,7 @@ void RewriteModernObjC::SynthMsgSendSuperStretFunctionDecl() {
SourceLocation(),
msgSendIdent,
msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendFpretFunctionDecl - double objc_msgSend_fpret(id self, SEL op, ...);
@@ -2547,7 +2547,7 @@ void RewriteModernObjC::SynthMsgSendFpretFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetClassFunctionDecl - Class objc_getClass(const char *name);
@@ -2561,7 +2561,7 @@ void RewriteModernObjC::SynthGetClassFunctionDecl() {
SourceLocation(),
SourceLocation(),
getClassIdent, getClassType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetSuperClassFunctionDecl - Class class_getSuperclass(Class cls);
@@ -2577,7 +2577,7 @@ void RewriteModernObjC::SynthGetSuperClassFunctionDecl() {
SourceLocation(),
getSuperClassIdent,
getClassType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetMetaClassFunctionDecl - Class objc_getMetaClass(const char *name);
@@ -2591,7 +2591,7 @@ void RewriteModernObjC::SynthGetMetaClassFunctionDecl() {
SourceLocation(),
SourceLocation(),
getClassIdent, getClassType,
- 0, SC_Extern, SC_None);
+ 0, SC_Extern);
}
Stmt *RewriteModernObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
@@ -2624,7 +2624,7 @@ Stmt *RewriteModernObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), &Context->Idents.get(S),
- strType, 0, SC_Static, SC_None);
+ strType, 0, SC_Static);
DeclRefExpr *DRE = new (Context) DeclRefExpr(NewVD, false, strType, VK_LValue,
SourceLocation());
Expr *Unop = new (Context) UnaryOperator(DRE, UO_AddrOf,
@@ -3135,7 +3135,7 @@ static SourceLocation getFunctionSourceLocation (RewriteModernObjC &R,
if (!LSD->getRBraceLoc().isValid())
return LSD->getExternLoc();
}
- if (FD->getStorageClassAsWritten() != SC_None)
+ if (FD->getStorageClass() != SC_None)
R.RewriteBlockLiteralFunctionDecl(FD);
return FD->getTypeSpecStartLoc();
}
@@ -3246,7 +3246,7 @@ Expr *RewriteModernObjC::SynthMsgSendStretCallExpr(FunctionDecl *MsgSendStretFla
IdentifierInfo *ID = &Context->Idents.get(name);
FunctionDecl *FD = FunctionDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), ID, castType, 0,
- SC_Extern, SC_None, false, false);
+ SC_Extern, false, false);
DeclRefExpr *DRE = new (Context) DeclRefExpr(FD, false, castType, VK_RValue,
SourceLocation());
CallExpr *STCE = new (Context) CallExpr(*Context, DRE, MsgExprs,
@@ -3719,7 +3719,7 @@ Stmt *RewriteModernObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
IdentifierInfo *ID = &Context->Idents.get(Name);
VarDecl *VD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), ID, getProtocolType(), 0,
- SC_Extern, SC_None);
+ SC_Extern);
DeclRefExpr *DRE = new (Context) DeclRefExpr(VD, false, getProtocolType(),
VK_LValue, SourceLocation());
Expr *DerefExpr = new (Context) UnaryOperator(DRE, UO_AddrOf,
@@ -5399,7 +5399,7 @@ FunctionDecl *RewriteModernObjC::SynthBlockInitFunctionDecl(StringRef name) {
QualType FType = Context->getFunctionNoProtoType(Context->VoidPtrTy);
return FunctionDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), ID, FType, 0, SC_Extern,
- SC_None, false, false);
+ false, false);
}
Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
@@ -5500,7 +5500,7 @@ Stmt *RewriteModernObjC::SynthBlockInitExpr(BlockExpr *Exp,
SourceLocation(), SourceLocation(),
&Context->Idents.get(DescData.c_str()),
Context->VoidPtrTy, 0,
- SC_Static, SC_None);
+ SC_Static);
UnaryOperator *DescRefExpr =
new (Context) UnaryOperator(new (Context) DeclRefExpr(NewVD, false,
Context->VoidPtrTy,
@@ -7762,7 +7762,7 @@ Stmt *RewriteModernObjC::RewriteObjCIvarRefExpr(ObjCIvarRefExpr *IV) {
BaseExpr);
VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), &Context->Idents.get(IvarOffsetName),
- Context->UnsignedLongTy, 0, SC_Extern, SC_None);
+ Context->UnsignedLongTy, 0, SC_Extern);
DeclRefExpr *DRE = new (Context) DeclRefExpr(NewVD, false,
Context->UnsignedLongTy, VK_LValue,
SourceLocation());
diff --git a/lib/Rewrite/Frontend/RewriteObjC.cpp b/lib/Rewrite/Frontend/RewriteObjC.cpp
index 108041753d..2f5cd0f6c6 100644
--- a/lib/Rewrite/Frontend/RewriteObjC.cpp
+++ b/lib/Rewrite/Frontend/RewriteObjC.cpp
@@ -2267,7 +2267,7 @@ void RewriteObjC::SynthSelGetUidFunctionDecl() {
SourceLocation(),
SourceLocation(),
SelGetUidIdent, getFuncType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
void RewriteObjC::RewriteFunctionDecl(FunctionDecl *FD) {
@@ -2363,7 +2363,7 @@ void RewriteObjC::SynthSuperContructorFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType,
- 0, SC_Extern, SC_None);
+ 0, SC_Extern);
}
// SynthMsgSendFunctionDecl - id objc_msgSend(id self, SEL op, ...);
@@ -2382,7 +2382,7 @@ void RewriteObjC::SynthMsgSendFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendSuperFunctionDecl - id objc_msgSendSuper(struct objc_super *, SEL op, ...);
@@ -2404,7 +2404,7 @@ void RewriteObjC::SynthMsgSendSuperFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendStretFunctionDecl - id objc_msgSend_stret(id self, SEL op, ...);
@@ -2423,7 +2423,7 @@ void RewriteObjC::SynthMsgSendStretFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendSuperStretFunctionDecl -
@@ -2448,7 +2448,7 @@ void RewriteObjC::SynthMsgSendSuperStretFunctionDecl() {
SourceLocation(),
msgSendIdent,
msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthMsgSendFpretFunctionDecl - double objc_msgSend_fpret(id self, SEL op, ...);
@@ -2467,7 +2467,7 @@ void RewriteObjC::SynthMsgSendFpretFunctionDecl() {
SourceLocation(),
SourceLocation(),
msgSendIdent, msgSendType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetClassFunctionDecl - id objc_getClass(const char *name);
@@ -2481,7 +2481,7 @@ void RewriteObjC::SynthGetClassFunctionDecl() {
SourceLocation(),
SourceLocation(),
getClassIdent, getClassType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetSuperClassFunctionDecl - Class class_getSuperclass(Class cls);
@@ -2497,7 +2497,7 @@ void RewriteObjC::SynthGetSuperClassFunctionDecl() {
SourceLocation(),
getSuperClassIdent,
getClassType, 0,
- SC_Extern, SC_None);
+ SC_Extern);
}
// SynthGetMetaClassFunctionDecl - id objc_getMetaClass(const char *name);
@@ -2511,7 +2511,7 @@ void RewriteObjC::SynthGetMetaClassFunctionDecl() {
SourceLocation(),
SourceLocation(),
getClassIdent, getClassType,
- 0, SC_Extern, SC_None);
+ 0, SC_Extern);
}
Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
@@ -2544,7 +2544,7 @@ Stmt *RewriteObjC::RewriteObjCStringLiteral(ObjCStringLiteral *Exp) {
VarDecl *NewVD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), &Context->Idents.get(S),
- strType, 0, SC_Static, SC_None);
+ strType, 0, SC_Static);
DeclRefExpr *DRE = new (Context) DeclRefExpr(NewVD, false, strType, VK_LValue,
SourceLocation());
Expr *Unop = new (Context) UnaryOperator(DRE, UO_AddrOf,
@@ -3112,7 +3112,7 @@ Stmt *RewriteObjC::RewriteObjCProtocolExpr(ObjCProtocolExpr *Exp) {
IdentifierInfo *ID = &Context->Idents.get(Name);
VarDecl *VD = VarDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), ID, getProtocolType(), 0,
- SC_Extern, SC_None);
+ SC_Extern);
DeclRefExpr *DRE = new (Context) DeclRefExpr(VD, false, getProtocolType(),
VK_LValue, SourceLocation());
Expr *DerefExpr = new (Context) UnaryOperator(DRE, UO_AddrOf,
@@ -4448,7 +4448,7 @@ FunctionDecl *RewriteObjC::SynthBlockInitFunctionDecl(StringRef name) {
QualType FType = Context->getFunctionNoProtoType(Context->VoidPtrTy);
return FunctionDecl::Create(*Context, TUDecl, SourceLocation(),
SourceLocation(), ID, FType, 0, SC_Extern,
- SC_None, false, false);
+ false, false);
}
Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
@@ -4532,7 +4532,7 @@ Stmt *RewriteObjC::SynthBlockInitExpr(BlockExpr *Exp,
SourceLocation(), SourceLocation(),
&Context->Idents.get(DescData.c_str()),
Context->VoidPtrTy, 0,
- SC_Static, SC_None);
+ SC_Static);
UnaryOperator *DescRefExpr =
new (Context) UnaryOperator(new (Context) DeclRefExpr(NewVD, false,
Context->VoidPtrTy,