diff options
author | Steve Naroff <snaroff@apple.com> | 2008-01-25 22:14:40 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-01-25 22:14:40 +0000 |
commit | d6326c6fe586ba178734c49ba33a2c1af021822c (patch) | |
tree | 634b98bf1728fbaa2ec66ee16b7cee397d546a45 | |
parent | ef20c110ddd52fed129334e3b9b50e5237ddfe54 (diff) |
Add more support for Apple's "private extern" extension...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46371 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CodeGen/CodeGenModule.cpp | 1 | ||||
-rw-r--r-- | Parse/ParseDecl.cpp | 3 | ||||
-rw-r--r-- | Sema/SemaDecl.cpp | 11 | ||||
-rw-r--r-- | include/clang/AST/Decl.h | 2 | ||||
-rw-r--r-- | include/clang/Parse/DeclSpec.h | 3 |
5 files changed, 11 insertions, 9 deletions
diff --git a/CodeGen/CodeGenModule.cpp b/CodeGen/CodeGenModule.cpp index e841ee5492..407812f21d 100644 --- a/CodeGen/CodeGenModule.cpp +++ b/CodeGen/CodeGenModule.cpp @@ -572,6 +572,7 @@ void CodeGenModule::EmitGlobalVar(const FileVarDecl *D) { assert(0 && "Can't have auto or register globals"); case VarDecl::None: case VarDecl::Extern: + case VarDecl::PrivateExtern: // todo: common break; case VarDecl::Static: diff --git a/Parse/ParseDecl.cpp b/Parse/ParseDecl.cpp index 99be5caf3f..003554fbaa 100644 --- a/Parse/ParseDecl.cpp +++ b/Parse/ParseDecl.cpp @@ -447,8 +447,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS) { isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_extern, Loc, PrevSpec); break; case tok::kw___private_extern__: - // FIXME: Implement private extern. - isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_extern, Loc, PrevSpec); + isInvalid = DS.SetStorageClassSpec(DeclSpec::SCS_private_extern, Loc, PrevSpec); break; case tok::kw_static: if (DS.isThreadSpecified()) diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index b38cd4cdb6..e674582eb0 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -705,11 +705,12 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) { VarDecl::StorageClass SC; switch (D.getDeclSpec().getStorageClassSpec()) { default: assert(0 && "Unknown storage class!"); - case DeclSpec::SCS_unspecified: SC = VarDecl::None; break; - case DeclSpec::SCS_extern: SC = VarDecl::Extern; break; - case DeclSpec::SCS_static: SC = VarDecl::Static; break; - case DeclSpec::SCS_auto: SC = VarDecl::Auto; break; - case DeclSpec::SCS_register: SC = VarDecl::Register; break; + case DeclSpec::SCS_unspecified: SC = VarDecl::None; break; + case DeclSpec::SCS_extern: SC = VarDecl::Extern; break; + case DeclSpec::SCS_static: SC = VarDecl::Static; break; + case DeclSpec::SCS_auto: SC = VarDecl::Auto; break; + case DeclSpec::SCS_register: SC = VarDecl::Register; break; + case DeclSpec::SCS_private_extern: SC = VarDecl::PrivateExtern; break; } if (S->getParent() == 0) { // C99 6.9p2: The storage-class specifiers auto and register shall not diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 0bd250d99b..9e78de3d2e 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -281,7 +281,7 @@ protected: class VarDecl : public ValueDecl { public: enum StorageClass { - None, Extern, Static, Auto, Register + None, Extern, Static, Auto, Register, PrivateExtern }; StorageClass getStorageClass() const { return (StorageClass)SClass; } diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h index 307959f83a..bb2773217e 100644 --- a/include/clang/Parse/DeclSpec.h +++ b/include/clang/Parse/DeclSpec.h @@ -38,7 +38,8 @@ public: SCS_extern, SCS_static, SCS_auto, - SCS_register + SCS_register, + SCS_private_extern }; // type-specifier |