forked from OSchip/llvm-project
remove #include of clang/Parse/DeclSpec.h from clang/AST/Decl.h
llvm-svn: 39186
This commit is contained in:
parent
da8aa7b3a8
commit
591a675b1c
|
@ -14,6 +14,7 @@
|
|||
#include "Sema.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/AST/Type.h"
|
||||
#include "clang/Parse/DeclSpec.h"
|
||||
#include "clang/Parse/Scope.h"
|
||||
#include "clang/Lex/IdentifierTable.h"
|
||||
using namespace llvm;
|
||||
|
@ -22,8 +23,6 @@ using namespace clang;
|
|||
|
||||
bool Sema::isTypeName(const IdentifierInfo &II, Scope *S) const {
|
||||
Decl *D = II.getFETokenInfo<Decl>();
|
||||
|
||||
|
||||
return D != 0 && isa<TypeDecl>(D);
|
||||
}
|
||||
|
||||
|
@ -76,9 +75,9 @@ Sema::ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init,
|
|||
if (D.getDeclSpec().StorageClassSpec == DeclSpec::SCS_typedef) {
|
||||
New = ParseTypedefDecl(S, D, PrevDecl);
|
||||
} else if (D.isFunctionDeclarator())
|
||||
New = new FunctionDecl(II, D.getDeclSpec(), PrevDecl);
|
||||
New = new FunctionDecl(II, PrevDecl);
|
||||
else
|
||||
New = new VarDecl(II, D.getDeclSpec(), PrevDecl);
|
||||
New = new VarDecl(II, PrevDecl);
|
||||
|
||||
if (!New) return 0;
|
||||
|
||||
|
@ -112,6 +111,6 @@ Sema::ParseFunctionDefinition(Scope *S, Declarator &D, StmtTy *Body) {
|
|||
Decl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, Decl *PrevDecl) {
|
||||
assert(D.getIdentifier() && "Wrong callback for declspec withotu declarator");
|
||||
|
||||
return new TypedefDecl(D.getIdentifier(), D.getDeclSpec(), PrevDecl);
|
||||
return new TypedefDecl(D.getIdentifier(), PrevDecl);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "Sema.h"
|
||||
#include "clang/AST/ASTContext.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/Parse/DeclSpec.h"
|
||||
using namespace llvm;
|
||||
using namespace clang;
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "Sema.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/AST/Type.h"
|
||||
#include "clang/Parse/DeclSpec.h"
|
||||
#include "clang/Parse/Scope.h"
|
||||
#include "clang/Lex/IdentifierTable.h"
|
||||
using namespace llvm;
|
||||
|
@ -22,8 +23,6 @@ using namespace clang;
|
|||
|
||||
bool Sema::isTypeName(const IdentifierInfo &II, Scope *S) const {
|
||||
Decl *D = II.getFETokenInfo<Decl>();
|
||||
|
||||
|
||||
return D != 0 && isa<TypeDecl>(D);
|
||||
}
|
||||
|
||||
|
@ -76,9 +75,9 @@ Sema::ParseDeclarator(Scope *S, Declarator &D, ExprTy *Init,
|
|||
if (D.getDeclSpec().StorageClassSpec == DeclSpec::SCS_typedef) {
|
||||
New = ParseTypedefDecl(S, D, PrevDecl);
|
||||
} else if (D.isFunctionDeclarator())
|
||||
New = new FunctionDecl(II, D.getDeclSpec(), PrevDecl);
|
||||
New = new FunctionDecl(II, PrevDecl);
|
||||
else
|
||||
New = new VarDecl(II, D.getDeclSpec(), PrevDecl);
|
||||
New = new VarDecl(II, PrevDecl);
|
||||
|
||||
if (!New) return 0;
|
||||
|
||||
|
@ -112,6 +111,6 @@ Sema::ParseFunctionDefinition(Scope *S, Declarator &D, StmtTy *Body) {
|
|||
Decl *Sema::ParseTypedefDecl(Scope *S, Declarator &D, Decl *PrevDecl) {
|
||||
assert(D.getIdentifier() && "Wrong callback for declspec withotu declarator");
|
||||
|
||||
return new TypedefDecl(D.getIdentifier(), D.getDeclSpec(), PrevDecl);
|
||||
return new TypedefDecl(D.getIdentifier(), PrevDecl);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include "Sema.h"
|
||||
#include "clang/AST/ASTContext.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/Parse/DeclSpec.h"
|
||||
using namespace llvm;
|
||||
using namespace clang;
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#define LLVM_CLANG_AST_DECL_H
|
||||
|
||||
#include "clang/Basic/SourceLocation.h"
|
||||
#include "clang/Parse/DeclSpec.h" // FIXME: Eliminate.
|
||||
|
||||
namespace llvm {
|
||||
namespace clang {
|
||||
|
@ -36,11 +35,6 @@ private:
|
|||
/// variable, the tag for a struct).
|
||||
IdentifierInfo *Identifier;
|
||||
|
||||
/// DeclarationSpecifier - Information about storage class, type specifiers,
|
||||
/// etc. FIXME: This should be eliminated once we have fully converted types
|
||||
/// over.
|
||||
DeclSpec DeclarationSpecifier;
|
||||
|
||||
/// Type.
|
||||
|
||||
/// DeclKind - This indicates which class this is.
|
||||
|
@ -51,8 +45,8 @@ private:
|
|||
Decl *Next;
|
||||
|
||||
public:
|
||||
Decl(IdentifierInfo *Id, const DeclSpec &DS, Kind DK, Decl *next)
|
||||
: Identifier(Id), DeclarationSpecifier(DS), DeclKind(DK), Next(next) {}
|
||||
Decl(IdentifierInfo *Id, Kind DK, Decl *next)
|
||||
: Identifier(Id), DeclKind(DK), Next(next) {}
|
||||
virtual ~Decl();
|
||||
|
||||
const IdentifierInfo *getIdentifier() const { return Identifier; }
|
||||
|
@ -69,8 +63,8 @@ public:
|
|||
/// Objective-C classes.
|
||||
class TypeDecl : public Decl {
|
||||
public:
|
||||
TypeDecl(IdentifierInfo *Id, const DeclSpec &DS, Kind DK, Decl *Next)
|
||||
: Decl(Id, DS, DK, Next) {}
|
||||
TypeDecl(IdentifierInfo *Id, Kind DK, Decl *Next)
|
||||
: Decl(Id, DK, Next) {}
|
||||
|
||||
// Implement isa/cast/dyncast/etc.
|
||||
static bool classof(const Decl *D) { return D->getKind() == Typedef; }
|
||||
|
@ -80,8 +74,8 @@ public:
|
|||
class TypedefDecl : public TypeDecl {
|
||||
public:
|
||||
// FIXME: Remove Declarator argument.
|
||||
TypedefDecl(IdentifierInfo *Id, const DeclSpec &DS, Decl *Next)
|
||||
: TypeDecl(Id, DS, Typedef, Next) {}
|
||||
TypedefDecl(IdentifierInfo *Id, Decl *Next)
|
||||
: TypeDecl(Id, Typedef, Next) {}
|
||||
|
||||
// Implement isa/cast/dyncast/etc.
|
||||
static bool classof(const Decl *D) { return D->getKind() == Typedef; }
|
||||
|
@ -94,8 +88,8 @@ class FunctionDecl : public Decl {
|
|||
// Args etc.
|
||||
Stmt *Body; // Null if a prototype.
|
||||
public:
|
||||
FunctionDecl(IdentifierInfo *Id, const DeclSpec &DS, Decl *Next)
|
||||
: Decl(Id, DS, Function, Next), Body(0) {}
|
||||
FunctionDecl(IdentifierInfo *Id, Decl *Next)
|
||||
: Decl(Id, Function, Next), Body(0) {}
|
||||
|
||||
Stmt *getBody() const { return Body; }
|
||||
void setBody(Stmt *B) { Body = B; }
|
||||
|
@ -111,8 +105,8 @@ public:
|
|||
class VarDecl : public Decl {
|
||||
// Initializer.
|
||||
public:
|
||||
VarDecl(IdentifierInfo *Id, const DeclSpec &DS, Decl *Next)
|
||||
: Decl(Id, DS, Variable, Next) {}
|
||||
VarDecl(IdentifierInfo *Id, Decl *Next)
|
||||
: Decl(Id, Variable, Next) {}
|
||||
|
||||
|
||||
// Implement isa/cast/dyncast/etc.
|
||||
|
|
Loading…
Reference in New Issue