From: John McCall Date: Mon, 18 Jan 2010 23:21:37 +0000 (+0000) Subject: Move AccessSpecifier into the new Specifiers.h; fixes the layering violations X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad2b804faf29042e6c4e331d0987f103f1e2fd31;p=clang Move AccessSpecifier into the new Specifiers.h; fixes the layering violations inherent in, well, pretty much every use of AccessSpecifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93804 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 0902b450a4..775bce2a15 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -16,8 +16,7 @@ #include "clang/AST/Attr.h" #include "clang/AST/Type.h" -// FIXME: Layering violation -#include "clang/Parse/AccessSpecifier.h" +#include "clang/Basic/Specifiers.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/ADT/PointerUnion.h" diff --git a/include/clang/Basic/Specifiers.h b/include/clang/Basic/Specifiers.h index 5f00a46d8b..88e4396593 100644 --- a/include/clang/Basic/Specifiers.h +++ b/include/clang/Basic/Specifiers.h @@ -67,6 +67,15 @@ namespace clang { /*DeclSpec::TSW*/ unsigned Width : 2; bool ModeAttr : 1; }; + + /// AccessSpecifier - A C++ access specifier (none, public, private, + /// protected). + enum AccessSpecifier { + AS_none, + AS_public, + AS_protected, + AS_private + }; } #endif // LLVM_CLANG_BASIC_SPECIFIERS_H diff --git a/include/clang/Parse/AccessSpecifier.h b/include/clang/Parse/AccessSpecifier.h deleted file mode 100644 index 8d2cee8ea4..0000000000 --- a/include/clang/Parse/AccessSpecifier.h +++ /dev/null @@ -1,30 +0,0 @@ -//===--- AccessSpecifier.h - C++ Access Specifiers -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines interfaces used for C++ access specifiers. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_CLANG_PARSE_ACCESS_SPECIFIER_H -#define LLVM_CLANG_PARSE_ACCESS_SPECIFIER_H - -namespace clang { - -/// AccessSpecifier - A C++ access specifier (none, public, private, -/// protected). -enum AccessSpecifier { - AS_none, - AS_public, - AS_protected, - AS_private -}; - -} // end namespace clang - -#endif diff --git a/include/clang/Parse/Action.h b/include/clang/Parse/Action.h index 4b9ff7be0d..ff33f5039d 100644 --- a/include/clang/Parse/Action.h +++ b/include/clang/Parse/Action.h @@ -16,9 +16,9 @@ #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/SourceLocation.h" +#include "clang/Basic/Specifiers.h" #include "clang/Basic/TemplateKinds.h" #include "clang/Basic/TypeTraits.h" -#include "clang/Parse/AccessSpecifier.h" #include "clang/Parse/DeclSpec.h" #include "clang/Parse/Ownership.h" #include "llvm/Support/PrettyStackTrace.h" diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 0fc9413c30..e7cb0a2493 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -14,8 +14,8 @@ #ifndef LLVM_CLANG_PARSE_PARSER_H #define LLVM_CLANG_PARSE_PARSER_H +#include "clang/Basic/Specifiers.h" #include "clang/Lex/Preprocessor.h" -#include "clang/Parse/AccessSpecifier.h" #include "clang/Parse/Action.h" #include "clang/Parse/DeclSpec.h" #include "llvm/ADT/OwningPtr.h"