Skip to content

Commit

Permalink
Add a c'tor for non-NONE implicit statements and add the ability to a…
Browse files Browse the repository at this point in the history
…dd the letter specs.
  • Loading branch information
Bill Wendling committed Oct 24, 2011
1 parent 01a4d2f commit f427fee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/flang/AST/Stmt.h
Expand Up @@ -231,12 +231,20 @@ class ImportStmt : public Stmt {
/// specified in the statement.
///
class ImplicitStmt : public Stmt {
SmallVector<std::pair<const IdentifierInfo *,
const IdentifierInfo *>, 4> LetterSpecList;
QualType Ty;
bool None;

ImplicitStmt(SMLoc L, ExprResult StmtLabel);
ImplicitStmt(SMLoc L, QualType T, ExprResult StmtLabel);
public:
static ImplicitStmt *Create(ASTContext &C, SMLoc L, ExprResult StmtLabel);
static ImplicitStmt *Create(ASTContext &C, SMLoc L, QualType T,
ExprResult StmtLabel);

void addLetterSpec(const IdentifierInfo *L);
void addLetterSpec(const IdentifierInfo *First, const IdentifierInfo *Last);

static bool classof(const ImplicitStmt*) { return true; }
static bool classof(const Stmt *S) {
Expand Down
17 changes: 17 additions & 0 deletions lib/AST/Stmt.cpp
Expand Up @@ -102,11 +102,28 @@ ImportStmt *ImportStmt::Create(ASTContext &C,
ImplicitStmt::ImplicitStmt(SMLoc L, ExprResult StmtLabel)
: Stmt(Implicit, L, StmtLabel), None(true) {}

ImplicitStmt::ImplicitStmt(SMLoc L, QualType T, ExprResult StmtLabel)
: Stmt(Implicit, L, StmtLabel), None(false) {}

ImplicitStmt *ImplicitStmt::Create(ASTContext &C, SMLoc L,
ExprResult StmtLabel) {
return new (C) ImplicitStmt(L, StmtLabel);
}

ImplicitStmt *ImplicitStmt::Create(ASTContext &C, SMLoc L, QualType T,
ExprResult StmtLabel) {
return new (C) ImplicitStmt(L, T, StmtLabel);
}

void ImplicitStmt::addLetterSpec(const IdentifierInfo *L) {
LetterSpecList.push_back(std::make_pair(L, (const IdentifierInfo*)0));
}

void ImplicitStmt::addLetterSpec(const IdentifierInfo *First,
const IdentifierInfo *Last) {
LetterSpecList.push_back(std::make_pair(First, Last));
}

//===----------------------------------------------------------------------===//
// Asynchronous Statement
//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit f427fee

Please sign in to comment.