Skip to content
Browse files

Add a c'tor for non-NONE implicit statements and add the ability to a…

…dd the letter specs.
  • Loading branch information...
1 parent 01a4d2f commit f427fee33d6db11cc06703dba5e93c00aefa374d Bill Wendling committed Oct 24, 2011
Showing with 25 additions and 0 deletions.
  1. +8 −0 include/flang/AST/Stmt.h
  2. +17 −0 lib/AST/Stmt.cpp
View
8 include/flang/AST/Stmt.h
@@ -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) {
View
17 lib/AST/Stmt.cpp
@@ -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
//===----------------------------------------------------------------------===//

0 comments on commit f427fee

Please sign in to comment.
Something went wrong with that request. Please try again.